Examples:
   "#{Jets.config.project_namespace}-sleep_job-perform"
   "demo-dev-sleep_job-perform"
164998
def function_name
      # Example values:
      #   @app_class: admin/pages_controller
      #   @task.meth: index
      #   method: admin/pages_controller
      #   method: admin-pages_controller-index
      method = @app_class.underscore
      method = method.gsub('/','-').gsub(/[^0-9a-z\-_]/i, '') + "-#{@task.meth}"
      function_name = "#{Jets.config.project_namespace}-#{method}"
      # Returns nil if function name is too long.
      # CloudFormation will managed the the function name in this case.
      # A pretty function name won't be generated but the deploy will be successful.
      function_name.size > MAX_FUNCTION_NAME_SIZE ? nil : function_name
    end
19944
def result
      @task = 'jshint'
      @path = discover_path(@config.working_dir, 'javascripts', 'js')

      return unless temp_config(@task) && path_exists?(@path)

      node_module_exists(@task)

      jshint_cli = "jshint #{@path} --config=#{temp_config(@task)} --reporter=#{reporter_path('jshint.js')}"
      jshint_cli << " --exclude-path=#{temp_config(@settings[:jshintignore])}" if @settings.key?(:jshintignore)
      jshint = `#{jshint_cli}`

      @output[:files_inspected] ||= files_inspected('js')
      refine jshint
    end
159134
function usage(options) {
  var settings = {}
  var pack
  var main
  var example
  var name
  var cwd
  var header

  if (!options) {
    options = {}
  }

  cwd = options.cwd || process.cwd()

  try {
    pack = require(resolve(cwd, 'package.json'))
  } catch (error) {
    pack = {}
  }

  name = options.name || pack.name || null

  main = resolve(cwd, options.main || pack.main || 'index.js')

  example = options.example

  if (example) {
    example = require.resolve(resolve(cwd, example))
  } else {
    EXAMPLES.some(some)
  }

  settings.cwd = cwd
  settings.name = name
  settings.main = main
  settings.example = example

  header = toExpression(options.heading || DEFAULT_HEADING)

  return transform

  function transform(tree) {
    heading(tree, header, runFactory(settings))
  }

  function some(filepath) {
    filepath = resolve(cwd, filepath)

    if (exists(filepath)) {
      example = require.resolve(filepath)
      return true
    }

    return false
  }
}
126053
def compile_command(context, backend, config):
    
    logger = logging.getLogger("boussole")
    logger.info(u"Building project")

    # Discover settings file
    try:
        discovering = Discover(backends=[SettingsBackendJson,
                                         SettingsBackendYaml])
        config_filepath, config_engine = discovering.search(
            filepath=config,
            basedir=os.getcwd(),
            kind=backend
        )

        project = ProjectBase(backend_name=config_engine._kind_name)
        settings = project.backend_engine.load(filepath=config_filepath)
    except BoussoleBaseException as e:
        logger.critical(six.text_type(e))
        raise click.Abort()

    logger.debug(u"Settings file: {} ({})".format(
                 config_filepath, config_engine._kind_name))
    logger.debug(u"Project sources directory: {}".format(
                 settings.SOURCES_PATH))
    logger.debug(u"Project destination directory: {}".format(
                 settings.TARGET_PATH))
    logger.debug(u"Exclude patterns: {}".format(
                 settings.EXCLUDES))

    # Find all sources with their destination path
    try:
        compilable_files = ScssFinder().mirror_sources(
            settings.SOURCES_PATH,
            targetdir=settings.TARGET_PATH,
            excludes=settings.EXCLUDES
        )
    except BoussoleBaseException as e:
        logger.error(six.text_type(e))
        raise click.Abort()

    # Build all compilable stylesheets
    compiler = SassCompileHelper()
    errors = 0
    for src, dst in compilable_files:
        logger.debug(u"Compile: {}".format(src))

        output_opts = {}
        success, message = compiler.safe_compile(settings, src, dst)

        if success:
            logger.info(u"Output: {}".format(message), **output_opts)
        else:
            errors += 1
            logger.error(message)

    # Ensure correct exit code if error has occured
    if errors:
        raise click.Abort()
1204000
function buildCommandFunctions() {
        var fn_to_bind = {
            'unknown_command':     unknownCommand,
            'command':             allCommands,
            'command:msg':         {fn: msgCommand, description: translateText('command_description_msg')},
            'command:action':      {fn: actionCommand, description: translateText('command_description_action'), aliases: ['me']},
            'command:join':        {fn: joinCommand, description: translateText('command_description_join'), aliases: ['j']},
            'command:part':        {fn: partCommand, description: translateText('command_description_part'), aliases: ['p']},
            'command:cycle':       {fn: cycleCommand, description: translateText('command_description_cycle')},
            'command:nick':        {fn: nickCommand, description: translateText('command_description_nick')},
            'command:query':       {fn: queryCommand, description: translateText('command_description_query')},
            'command:invite':      {fn: inviteCommand, description: translateText('command_description_invite')},
            'command:topic':       {fn: topicCommand, description: translateText('command_description_topic')},
            'command:notice':      {fn: noticeCommand, description: translateText('command_description_notice')},
            'command:quote':       {fn: quoteCommand, description: translateText('command_description_quote'), aliases: ['raw']},
            'command:kick':        {fn: kickCommand, description: translateText('command_description_kick')},
            'command:names':       {fn: namesCommand, description: ''},
            'command:mode':        {fn: modeCommand, description: ''},
            'command:clear':       {fn: clearCommand, description: translateText('command_description_clear')},
            'command:ctcp':        {fn: ctcpCommand, description: translateText('command_description_ctcp')},
            'command:quit':        {fn: quitCommand, description: translateText('command_description_quit'), aliases: ['q']},
            'command:server':      {fn: serverCommand, description: translateText('command_description_server')},
            'command:whois':       {fn: whoisCommand, description: translateText('command_description_whois'), aliases: ['w']},
            'command:whowas':      {fn: whowasCommand, description: translateText('command_description_whowas')},
            'command:away':        {fn: awayCommand, description: translateText('command_description_away')},
            'command:encoding':    {fn: encodingCommand, description: translateText('command_description_encoding')},
            'command:channel':     {fn: channelCommand, description: ''},
            'command:applet':      {fn: appletCommand, description: ''},
            'command:settings':    {fn: settingsCommand, description: translateText('command_description_settings')},
            'command:script':      {fn: scriptCommand, description: translateText('command_description_script')}
        };


        fn_to_bind['command:css'] = {
            description: translateText('command_description_css'),
            fn: function(ev) {
                this.app.view.reloadStyles();
            }
        };


        fn_to_bind['command:js'] = {
            description: translateText('command_description_js'),
            fn: function(ev) {
                if (!ev.params[0]) return;
                $script(ev.params[0] + '?' + (new Date().getTime()));
            }
        };


        fn_to_bind['command:set'] = {
            description: translateText('command_description_set'),
            fn: function(ev) {
                if (!ev.params[0]) return;

                var setting = ev.params[0],
                    value;

                // Do we have a second param to set a value?
                if (ev.params[1]) {
                    ev.params.shift();

                    value = ev.params.join(' ');

                    // If we're setting a true boolean value..
                    if (value === 'true')
                        value = true;

                    // If we're setting a false boolean value..
                    if (value === 'false')
                        value = false;

                    // If we're setting a number..
                    if (parseInt(value, 10).toString() === value)
                        value = parseInt(value, 10);

                    _kiwi.global.settings.set(setting, value);
                }

                // Read the value to the user
                this.app.panels().active.addMsg('', styleText('set_setting', {text: setting + ' = ' + _kiwi.global.settings.get(setting).toString()}));
            }
        };


        fn_to_bind['command:save'] = {
            description: translateText('command_description_save'),
            fn: function(ev) {
                _kiwi.global.settings.save();
                this.app.panels().active.addMsg('', styleText('settings_saved', {text: translateText('client_models_application_settings_saved')}));
            }
        };


        fn_to_bind['command:alias'] = {
            description: translateText('command_description_alias'),
            fn: function(ev) {
                var that = this,
                    name, rule;

                // No parameters passed so list them
                if (!ev.params[1]) {
                    $.each(this.controlbox.preprocessor.aliases, function (name, rule) {
                        that.app.panels().server.addMsg(' ', styleText('list_aliases', {text: name + '   =>   ' + rule}));
                    });
                    return;
                }

                // Deleting an alias?
                if (ev.params[0] === 'del' || ev.params[0] === 'delete') {
                    name = ev.params[1];
                    if (name[0] !== '/') name = '/' + name;
                    delete this.controlbox.preprocessor.aliases[name];
                    return;
                }

                // Add the alias
                name = ev.params[0];
                ev.params.shift();
                rule = ev.params.join(' ');

                // Make sure the name starts with a slash
                if (name[0] !== '/') name = '/' + name;

                // Now actually add the alias
                this.controlbox.preprocessor.aliases[name] = rule;
            }
        };


        fn_to_bind['command:ignore'] = {
            description: translateText('command_description_ignore'),
            fn: function(ev) {
                var that = this,
                    ignore_list = this.app.connections.active_connection.ignore_list,
                    user_mask;

                // No parameters passed so list them
                if (!ev.params[0]) {
                    if (ignore_list.length > 0) {
                        this.app.panels().active.addMsg(' ', styleText('ignore_title', {text: translateText('client_models_application_ignore_title')}));
                        ignore_list.forEach(function(ignored) {
                            that.app.panels().active.addMsg(' ', styleText('ignored_pattern', {text: ignored.get('mask')}));
                        });
                    } else {
                        this.app.panels().active.addMsg(' ', styleText('ignore_none', {text: translateText('client_models_application_ignore_none')}));
                    }
                    return;
                }

                // We have a parameter, so add it, first convert it to a full mask.
                user_mask = toUserMask(ev.params[0]);
                ignore_list.addMask(user_mask);

                this.app.panels().active.addMsg(' ', styleText('ignore_nick', {text: translateText('client_models_application_ignore_nick', [user_mask])}));
            }
        };


        fn_to_bind['command:unignore'] = {
            description: translateText('command_description_unignore'),
            fn: function(ev) {
                var ignore_list = this.app.connections.active_connection.ignore_list,
                    user_mask, matches;

                if (!ev.params[0]) {
                    this.app.panels().active.addMsg(' ', styleText('ignore_stop_notice', {text: translateText('client_models_application_ignore_stop_notice')}));
                    return;
                }

                user_mask = toUserMask(ev.params[0]);
                matches = ignore_list.where({mask: user_mask});
                if (matches) {
                    ignore_list.remove(matches);
                }

                this.app.panels().active.addMsg(' ', styleText('ignore_stopped', {text: translateText('client_models_application_ignore_stopped', [user_mask])}));
            }
        };


        return fn_to_bind;
    }
494867
def main(output):
    

    client = Session().client('cloudresourcemanager', 'v1', 'projects')

    results = []
    for page in client.execute_paged_query('list', {}):
        for project in page.get('projects', []):

            if project['lifecycleState'] != 'ACTIVE':
                continue

            project_info = {
                'project_id': project['projectId'],
                'name': project['name'],
            }

            if 'labels' in project:
                project_info['tags'] = [
                    'label:%s:%s' % (k, v) for k, v in project.get('labels', {}).items()]
            results.append(project_info)

    output.write(
        yaml.safe_dump({'projects': results}, default_flow_style=False))
1258538
def define_task
      namespace(@namespace) do
        namespace("schema") do
          desc("Dump the schema to IDL in #{idl_path}")
          task :idl => @dependencies do
            write_outfile(:to_definition, idl_path)
            puts "Schema IDL dumped into #{idl_path}"
          end

          desc("Dump the schema to JSON in #{json_path}")
          task :json => @dependencies do
            write_outfile(:to_json, json_path)
            puts "Schema JSON dumped into #{json_path}"
          end

          desc("Dump the schema to JSON and IDL")
          task :dump => [:idl, :json]
        end
      end
    end
278776
def worker(namespace, name, branch='master'):
    ''''''
    with repository(namespace, name, branch) as (path, latest, cache):
        if cache.get(latest, None) and json.loads(cache[latest])['status'] != 'starting':
            return 'Build already started'

        data = {'status': 'in_progress', 'result': ''}
        cache[latest] = json.dumps(data)
        test_output = tox(_iter=True)
        try:
            for line in test_output:
                data['result'] += line
                cache[latest] = json.dumps(data)
            data['build_success'] = True
        except Exception:
            data['build_success'] = False
        data['status'] = 'complete'
        cache[latest] = json.dumps(data)
        return 'Build successfully completed'
1180345
public static void main(String[] args) throws IOException {
		ApiOvhCore core = new ApiOvhCore();
		ApiOvhCloud cloud = new ApiOvhCloud(core);
		ArrayList<String> projects = cloud.project_GET();
		for (String project: projects) {
			System.out.println(project);
			ArrayList<OvhNetwork> networds = cloud.project_serviceName_network_private_GET(project);
			List<String> debug = networds.stream().map(ApiOvhUtils::objectJsonBody).collect(Collectors.toList());
			
			//String txt = ApiOvhUtils.objectJsonBody(payload);

			System.out.println(debug);
		}
//		project_serviceName_network_private_GET
	}
371849
def startproject(project_name):
    
    # the destination path
    dst_path = os.path.join(os.getcwd(), project_name)
    start_init_info(dst_path)

    # create dst path
    _mkdir_p(dst_path)

    # create project tree
    os.chdir(dst_path)
    # create files
    init_code('manage.py', _manage_admin_code)
    init_code('requirement.txt', _requirement_admin_code)
    init_code('config.py', _config_sql_code)

    # create app/
    app_path = os.path.join(dst_path, 'app')
    _mkdir_p(app_path)

    # create files
    os.chdir(app_path)
    init_code('models.py', _models_admin_code)
    init_code('__init__.py', _init_admin_code)

    # create templates and static
    css_path, templates_path = create_templates_static_files(app_path)
    # create css files
    os.chdir(css_path)
    init_code('sign.css', _auth_login_css_code)

    # create main blueprint
    create_blueprint(
        app_path,
        'main',
        _views_blueprint_code % ('main', 'main'),
        _forms_basic_code,
        templates_path
    )

    # create auth blueprint
    auth_templates_path = create_blueprint(
        app_path,
        'auth',
        _auth_views_code,
        _auth_forms_code,
        templates_path
    )
    # create auth templates files
    os.chdir(auth_templates_path)
    init_code('login.html', _auth_login_html_code)

    # create admin site
    admin_path = os.path.join(app_path, 'admin')
    _mkdir_p(admin_path)

    # create admin files
    os.chdir(admin_path)
    init_code('__init__.py', '')
    init_code('views.py', _admin_views_code)

    # create admin templates
    os.chdir(templates_path)
    admin_templates_path = os.path.join(templates_path, 'admin')
    _mkdir_p(admin_templates_path)

    # create admin templates files
    os.chdir(admin_templates_path)
    init_code('index.html', _admin_index_html_code)
    init_code('logout.html', _admin_logout_html_code)

    init_done_info()
52474
function suite() {
  process.env.NODESASS_COV = 1;

  var coveralls = spawn(bin('coveralls'));

  var args = [bin('_mocha')].concat(['--reporter', 'mocha-lcov-reporter']);
  var mocha = spawn(process.sass.runtime.execPath, args, {
    env: process.env
  });

  mocha.on('error', function(err) {
    console.error(err);
    process.exit(1);
  });

  mocha.stderr.setEncoding('utf8');
  mocha.stderr.on('data', function(err) {
    console.error(err);
    process.exit(1);
  });

  mocha.stdout.pipe(coveralls.stdin);
}
1266632
def example_describe_configs(a, args):
    

    resources = [ConfigResource(restype, resname) for
                 restype, resname in zip(args[0::2], args[1::2])]

    fs = a.describe_configs(resources)

    # Wait for operation to finish.
    for res, f in fs.items():
        try:
            configs = f.result()
            for config in iter(configs.values()):
                print_config(config, 1)

        except KafkaException as e:
            print("Failed to describe {}: {}".format(res, e))
        except Exception:
            raise
318655
def standard_rake_options
      [
        ['--classic-namespace', '-C', "Put Task and FileTask in the top level namespace",
          lambda { |value|
            require 'rake/classic_namespace'
            options.classic_namespace = true
          }
        ],
        ['--describe', '-D [PATTERN]', "Describe the tasks (matching optional PATTERN), then exit.",
          lambda { |value|
            options.show_tasks = true
            options.full_description = true
            options.show_task_pattern = Regexp.new(value || '')
          }
        ],
        ['--dry-run', '-n', "Do a dry run without executing actions.",
          lambda { |value|
            verbose(true)
            nowrite(true)
            options.dryrun = true
            options.trace = true
          }
        ],
        ['--execute',  '-e CODE', "Execute some Ruby code and exit.",
          lambda { |value|
            eval(value)
            exit
          }
        ],
        ['--execute-print',  '-p CODE', "Execute some Ruby code, print the result, then exit.",
          lambda { |value|
            puts eval(value)
            exit
          }
        ],
        ['--execute-continue',  '-E CODE',
          "Execute some Ruby code, then continue with normal task processing.",
          lambda { |value| eval(value) }            
        ],
        ['--libdir', '-I LIBDIR', "Include LIBDIR in the search path for required modules.",
          lambda { |value| $:.push(value) }
        ],
        ['--prereqs', '-P', "Display the tasks and dependencies, then exit.",
          lambda { |value| options.show_prereqs = true }
        ],
        ['--quiet', '-q', "Do not log messages to standard output.",
          lambda { |value| verbose(false) }
        ],
        ['--rakefile', '-f [FILE]', "Use FILE as the rakefile.",
          lambda { |value| 
            value ||= ''
            @rakefiles.clear 
            @rakefiles << value
          }
        ],
        ['--rakelibdir', '--rakelib', '-R RAKELIBDIR',
          "Auto-import any .rake files in RAKELIBDIR. (default is 'rakelib')",
          lambda { |value| options.rakelib = value.split(':') }
        ],
        ['--require', '-r MODULE', "Require MODULE before executing rakefile.",
          lambda { |value|
            begin
              require value
            rescue LoadError => ex
              begin
                rake_require value
              rescue LoadError => ex2
                raise ex
              end
            end
          }
        ],
        ['--rules', "Trace the rules resolution.",
          lambda { |value| options.trace_rules = true }
        ],
        ['--no-search', '--nosearch', '-N', "Do not search parent directories for the Rakefile.",
          lambda { |value| options.nosearch = true }
        ],
        ['--silent', '-s', "Like --quiet, but also suppresses the 'in directory' announcement.",
          lambda { |value|
            verbose(false)
            options.silent = true
          }
        ],
        ['--system',  '-g',
          "Using system wide (global) rakefiles (usually '~/.rake/*.rake').",
          lambda { |value| options.load_system = true }
        ],
        ['--no-system', '--nosystem', '-G',
          "Use standard project Rakefile search paths, ignore system wide rakefiles.",
          lambda { |value| options.ignore_system = true }
        ],
        ['--tasks', '-T [PATTERN]', "Display the tasks (matching optional PATTERN) with descriptions, then exit.",
          lambda { |value|
            options.show_tasks = true
            options.show_task_pattern = Regexp.new(value || '')
            options.full_description = false
          }
        ],
        ['--trace', '-t', "Turn on invoke/execute tracing, enable full backtrace.",
          lambda { |value|
            options.trace = true
            verbose(true)
          }
        ],
        ['--verbose', '-v', "Log message to standard output.",
          lambda { |value| verbose(true) }
        ],
        ['--version', '-V', "Display the program version.",
          lambda { |value|
            puts "rake, version #{RAKEVERSION}"
            exit
          }
        ]
      ]
    end
1062425
def config_apis
      source = "#{Dir.pwd}/app/apis/#{@project_name}/#{@scaffold_name}s/base_apis.rb"
      content = ['AppName','ScaffoldName', 'Model', 'model']
      replacement = ["#{@project_class}", "#{model_class}s", "#{model_class}", "#{@scaffold_name}"]
      for i in 0..3 do
        modify_content(source, content[i], replacement[i])
      end
    end
1310768
function commandExamples(examples) {
  if (!examples || !examples.length) {
    return ''
  }
  let exampleRender = `**Examples**${newLine}`
  exampleRender += '\`\`\`bash\n'
  examples.forEach((ex) => {
    console.log('ex', ex)
    exampleRender += `${ex}\n`
  })
  exampleRender += `\`\`\`${newLine}`
  return exampleRender
}
975931
public void performActions() {
		if (this.clientConfiguration.getActions().isEmpty()) {
			this.clientConfiguration.printHelp();
			return;
		}

		this.dumpProcessingController.setOfflineMode(this.clientConfiguration
				.getOfflineMode());

		if (this.clientConfiguration.getDumpDirectoryLocation() != null) {
			try {
				this.dumpProcessingController
						.setDownloadDirectory(this.clientConfiguration
								.getDumpDirectoryLocation());
			} catch (IOException e) {
				logger.error("Could not set download directory to "
						+ this.clientConfiguration.getDumpDirectoryLocation()
						+ ": " + e.getMessage());
				logger.error("Aborting");
				return;
			}
		}

		dumpProcessingController.setLanguageFilter(this.clientConfiguration
				.getFilterLanguages());
		dumpProcessingController.setSiteLinkFilter(this.clientConfiguration
				.getFilterSiteKeys());
		dumpProcessingController.setPropertyFilter(this.clientConfiguration
				.getFilterProperties());

		MwDumpFile dumpFile = this.clientConfiguration.getLocalDumpFile();

		if (dumpFile == null) {
			dumpFile = dumpProcessingController
					.getMostRecentDump(DumpContentType.JSON);
		} else {
			if (!dumpFile.isAvailable()) {
				logger.error("Dump file not found or not readable: "
						+ dumpFile.toString());
				return;
			}
		}

		this.clientConfiguration.setProjectName(dumpFile.getProjectName());
		this.clientConfiguration.setDateStamp(dumpFile.getDateStamp());

		boolean hasReadyProcessor = false;
		for (DumpProcessingAction props : this.clientConfiguration.getActions()) {

			if (!props.isReady()) {
				continue;
			}

			if (props.needsSites()) {
				prepareSites();
				if (this.sites == null) { // sites unavailable
					continue;
				}
				props.setSites(this.sites);
			}
			props.setDumpInformation(dumpFile.getProjectName(),
					dumpFile.getDateStamp());
			this.dumpProcessingController.registerEntityDocumentProcessor(
					props, null, true);
			hasReadyProcessor = true;
		}

		if (!hasReadyProcessor) {
			return; // silent; non-ready action should report its problem
					// directly
		}

		if (!this.clientConfiguration.isQuiet()) {
			EntityTimerProcessor entityTimerProcessor = new EntityTimerProcessor(
					0);
			this.dumpProcessingController.registerEntityDocumentProcessor(
					entityTimerProcessor, null, true);
		}
		openActions();
		this.dumpProcessingController.processDump(dumpFile);
		closeActions();

		try {
			writeReport();
		} catch (IOException e) {
			logger.error("Could not print report file: " + e.getMessage());
		}

	}
764070
def actions_for_project(self, project):
        """"""
        project.cflags = ["-O3", "-fno-omit-frame-pointer"]
        project.runtime_extension = time.RunWithTime(
            run.RuntimeExtension(project, self))
        return self.default_runtime_actions(project)