Main MixCloud path.
163248
def process_mixcloud(vargs):
    

    artist_url = vargs['artist_url']

    if 'mixcloud.com' in artist_url:
        mc_url = artist_url
    else:
        mc_url = 'https://mixcloud.com/' + artist_url

    filenames = scrape_mixcloud_url(mc_url, num_tracks=vargs['num_tracks'], folders=vargs['folders'], custom_path=vargs['path'])

    if vargs['open']:
        open_files(filenames)

    return
49867
def merge(self, paths):
        

        # Use local topojson binary
        topojson_binary = 'node_modules/bin/topojson'

        if not os.path.exists(topojson_binary):
            # try with global topojson binary
            topojson_binary = 'topojson'

        merge_cmd = '%(binary)s -o %(output_path)s --bbox -p -- %(paths)s' % {
            'output_path': self.args.output_path,
            'paths': ' '.join(paths),
            'binary': topojson_binary
        }

        sys.stdout.write('Merging layers\n')

        if self.args.verbose:
            sys.stdout.write('  %s\n' % merge_cmd)

        r = envoy.run(merge_cmd)

        if r.status_code != 0:
            sys.stderr.write(r.std_err)
1010722
function mixin(name, mix, g) {
      // Unnamed global
      if (isObject$1(name)) {
        mixin(("__" + (mixins_id++) + "__"), name, true);
        return
      }

      var store = g ? globals : mixins;

      // Getter
      if (!mix) {
        if (isUndefined(store[name]))
          { throw new Error(("Unregistered mixin: " + name)) }

        return store[name]
      }

      // Setter
      store[name] = isFunction$1(mix) ?
        extend(mix.prototype, store[name] || {}) && mix :
        extend(store[name] || {}, mix);
    }
627023
def main(global_settings, **settings):
    """"""
    my_session_factory = SignedCookieSessionFactory('itsaseekreet')
    # Add session engine
    config = Configurator(
        settings=settings,
        session_factory=my_session_factory
    )
    # Add static and templates
    config.add_static_view(name='static', path='static')
    config.include('pyramid_jinja2')
    config.add_jinja2_search_path('templates')
    config.include('ps_crud')

    # Setting up pyramid_sacrud
    config.include('pyramid_sacrud', route_prefix='admin')
    settings = config.get_settings()
    settings['pyramid_sacrud.models'] = (
        ('Docker', [Image(), ]),
    )

    # Make app
    config.scan('views')
    return config.make_wsgi_app()
735890
function createEntryPoint(paths, subPath, name) {
      var outputPath = path.join(packageDir, subPath || '', (name || 'index') + '.js'), requires;
      requires = Array.isArray(paths) ? getRequiresForArray(paths) : getRequiresForGroup(paths);
      var exports = "module.exports = require('sugar-core');";
      var outputBody = [STRICT, requires, exports].join('\n\n');
      writeFile(outputPath, outputBody);
    }
1297147
function _run() {
    _verifyCWD();

    var customStartupFilePath = path.resolve(process.cwd() + '/bin/www');

    if (fs.existsSync(customStartupFilePath)) {
        require(customStartupFilePath);
    } else if (fs.existsSync(PROJECT_INDEX)) {
        let service = require(PROJECT_INDEX);
        if (!(service instanceof Service)) {
            utils._stderr(`${PROJECT_INDEX} does not export a Service object`);
            process.exit(1);
        }

        service.listen();
    }
}
221308
function _main() {
  const srcIndexPath = join(DIST_DIR, 'index.html');
  const src404BodyPath = join(SRC_DIR, '404-body.html');
  const dst404PagePath = join(DIST_DIR, '404.html');

  const srcIndexContent = readFileSync(srcIndexPath, 'utf8');
  const src404BodyContent = readFileSync(src404BodyPath, 'utf8');
  const dst404PageContent = srcIndexContent.replace(/<body>[\s\S]+<\/body>/, src404BodyContent);

  if (dst404PageContent === srcIndexContent) {
    throw new Error(
        'Failed to generate \'404.html\'. ' +
        'The content of \'index.html\' does not match the expected pattern.');
  }

  writeFileSync(dst404PagePath, dst404PageContent);
}
475917
public void addAll(List<SoundCloudTrack> tracks) {
        for (SoundCloudTrack track : tracks) {
            add(mSoundCloudPlaylist.getTracks().size(), track);
        }
    }
1319288
function concactStatic (modulePath, config, cb) {
  var streamArr = [];
  var staticPath = require(path.join(modulePath, 'static-conf')).staticPath;
  streamArr.push(vinylFs
    .src([path.join(modulePath, config.dest, '_', 'static', 'css', '**', '*.css'), path.join(modulePath, config.dest, '_', 'static', 'sass', '**', '*.css')])
    .pipe(vinylFs.dest(path.join(modulePath, config.dest, '_static', 'css')))
  );
  streamArr.push(vinylFs
    .src(path.join(modulePath, config.dest, '_', 'static', 'js', '**', '*.js'))
    .pipe(vinylFs.dest(path.join(modulePath, config.dest, '_static', 'js')))
  );
  es.merge(streamArr).on('end', function () {
    var streamArr = [];
    if (_.isEmpty(staticPath)) {
      cb();
      return;
    }
    for (var key in staticPath) {
      // css
      if (path.extname(key).indexOf('css') >= 0) {
        streamArr.push(vinylFs
          .src(staticPath[key].map(function (item) {
            return path.join(modulePath, config.dest, '_', item);
          }))
          .pipe(concatCore(key))
          .pipe(vinylFs.dest(path.join(modulePath, config.dest, '_static', 'css'))));
      }

      // js
      if (path.extname(key).indexOf('js') >= 0) {
        streamArr.push(vinylFs
          .src(staticPath[key].map(function (item) {
            return path.join(modulePath, config.dest, '_', item);
          }))
          .pipe(concatCore(key))
          .pipe(vinylFs.dest(path.join(modulePath, config.dest, '_static', 'js'))));
      }
    }
    es.merge(streamArr).on('end', function () {
      cb();
    });
  });
}
1151565
def build_undercloud_on_libvirt(self, image_path,
                                    rhsm=None, repositories=[]):
        """"""
        self.run('sysctl net.ipv4.ip_forward=1')
        self.fetch_image(path=image_path, dest='/home/stack/guest_image.qcow2',
                         user='stack')
        # NOTE(Gonéri): this is a hack for our OpenStack, the MTU of its outgoing route
        # is 1400 and libvirt do not provide a mechanism to adjust the guests MTU.
        self.run("LIBGUESTFS_BACKEND=direct virt-customize -a /home/stack/guest_image.qcow2 --run-command 'echo MTU=\"1400\" >> /etc/sysconfig/network-scripts/ifcfg-eth0'")

        env = Environment()
        env.loader = FileSystemLoader(pkg_data_filename('template'))
        template = env.get_template('virt-setup-env.j2')
        self.run('mkdir -p /home/stack/DIB', user='stack')
        self.run('cp -v /etc/yum.repos.d/*.repo /home/stack/DIB', user='stack')
        # NOTE(Gonéri): Hack to be sure DIB won't complain because of missing gpg files
        # self.run('sed -i "s,gpgcheck=1,gpgcheck=0," /home/stack/DIB/*.repo', user='stack')
        dib_yum_repo_conf = self.run('find /home/stack/DIB -type f', user='stack')[0].split()
        virt_setup_template = {
            'dib_yum_repo_conf': dib_yum_repo_conf,
            'node': {
                'count': 2,
                'mem': 6144,
                'cpu': 2
            },
            'undercloud_node_mem': 8192,
            'guest_image_name': '/home/stack/guest_image.qcow2'
        }

        if rhsm is not None:
            virt_setup_template['rhsm'] = {
                'login': rhsm.get('login'),
                'password': rhsm.get('password', os.environ.get('RHN_PW')),
                'pool_id': rhsm.get('pool_id', ''),
                'repositories': [i['name'] for i in repositories if i['type'] == 'rhsm_channel']
            }
        virt_setup_env = template.render(virt_setup_template)
        self.create_file('virt-setup-env', virt_setup_env, user='stack')
        self.run('virsh destroy instack', ignore_error=True)
        self.run('virsh undefine instack --remove-all-storage', ignore_error=True)
        self.run('source virt-setup-env; instack-virt-setup', user='stack')
        undercloud_ip = self.run(
            '/sbin/ip n | grep $(tripleo get-vm-mac instack) | awk \'{print $1;}\'',
            user='stack')[0]
        assert undercloud_ip, 'undercloud should have an IP'
        undercloud = Undercloud(hostname=undercloud_ip,
                                via_ip=self.hostname,
                                user='root',
                                key_filename=self._key_filename)
        return undercloud
82948
def main():
    '''
    
    '''

    system('clear') # Must be system('cls') for windows

    setup()

    parser = argparse.ArgumentParser(
        description='Download songs with album art and metadata!')
    parser.add_argument('-c', '--config', action='store_true',
                        help='Set your API keys')
    parser.add_argument('-m', '--multiple', action='store', dest='multiple_file',
                        help='Download multiple songs from a text file list')
    parser.add_argument('-a', '--auto', action='store_true',
                        help='Automatically chooses top result')
    parser.add_argument('--album', action='store_true',
                        help='Downloads all songs from an album')
    args = parser.parse_args()
    arg_multiple = args.multiple_file or None
    arg_auto = args.auto or None
    arg_album = args.album or None
    arg_config = args.config


    if arg_config:
        add_config()

    elif arg_multiple and arg_album:
        log.log_error("Can't do both!")

    elif arg_album:
        album_name = input('Enter album name : ')
        try:
            tracks = get_tracks_from_album(album_name)
            for songs in tracks:
                print(songs)
            confirm = input(
                '\nAre these the songs you want to download? (Y/n)\n> ')

        except IndexError:
            log.log_error("Couldn't find album")
            exit()

        if confirm == '' or confirm.lower() == ('y'):
            for track_name in tracks:
                track_name = track_name + ' song'
                song_url, file_name = get_url(track_name, arg_auto)
                download_song(song_url, file_name)
                system('clear')
                repair.fix_music(file_name + '.mp3')

        elif confirm.lower() == 'n':
            log.log_error("Sorry, if appropriate results weren't found")
            exit()
        else:
            log.log_error('Invalid Input')
            exit()

    elif arg_multiple:
        with open(arg_multiple, "r") as f:
            file_names = []
            for line in f:
                file_names.append(line.rstrip('\n'))

        for files in file_names:
            files = files + ' song'
            song_url, file_name = get_url(files, arg_auto)
            download_song(song_url, file_name)
            system('clear')
            repair.fix_music(file_name + '.mp3')

    else:
        query = input('Enter Song Name : ')
        song_url, file_name = get_url(query, arg_auto)  # Gets YT url
        download_song(song_url, file_name)  # Saves as .mp3 file
        system('clear')
        repair.fix_music(file_name + '.mp3')
1208558
def init_dirs(main_dir: Path, logfilepath: Path):
    
    global MAIN_DIR, TEMP_DIR, DOWNLOAD_DIR, SAVESTAT_DIR, LOGFILE_PATH
    MAIN_DIR = main_dir
    TEMP_DIR = MAIN_DIR.joinpath(Path('temp/'))
    DOWNLOAD_DIR = MAIN_DIR.joinpath(Path('downloads/'))
    SAVESTAT_DIR = MAIN_DIR.joinpath(Path('savestates/'))
    LOGFILE_PATH = MAIN_DIR.joinpath(logfilepath)
1304869
function(next) {
            try { process.umask(core.umask); } catch(e) { logger.error("umask:", core.umask, e) }

            // Create all subfolders with permissions, run it before initializing db which may create files in the spool folder
            if (!cluster.isWorker && !core.worker) {
                Object.keys(core.path).forEach(function(p) {
                    var paths = Array.isArray(core.path[p]) ? core.path[p] : [core.path[p]];
                    paths.forEach(function(x) {
                        if (!x || path.isAbsolute(x)) return;
                        lib.mkdirSync(x);
                        lib.chownSync(this.uid, this.gid, x);
                    });
                });
            }
            next();
        }
1328068
function() {
		var api_url,
			self = this;

		// Create Dom element
		this._el.content_item	= TL.Dom.create("div", "tl-media-item tl-media-iframe tl-media-soundcloud tl-media-shadow", this._el.content);

		// Get Media ID
		this.media_id = this.data.url;

		// API URL
		api_url = "https://soundcloud.com/oembed?url=" + this.media_id + "&format=js&callback=?"

		// API Call
		TL.getJSON(api_url, function(d) {
			TL.Load.js("https://w.soundcloud.com/player/api.js", function() {//load soundcloud api for pausing.
				self.createMedia(d);
			});
		});

	}
409886
function _buildPaths() {
    var home = os.homedir();
    var path1 = path.resolve(home + '/Music/iTunes/iTunes Music Library.xml');
    var path2 = path.resolve(home + '/Music/iTunes/iTunes Library.xml');
    return [path1, path1];
}
388665
def cloud_config(path=None, env_var='SALT_CLOUD_CONFIG', defaults=None,
                 master_config_path=None, master_config=None,
                 providers_config_path=None, providers_config=None,
                 profiles_config_path=None, profiles_config=None):
    '''
    
    '''
    if path:
        config_dir = os.path.dirname(path)
    else:
        config_dir = salt.syspaths.CONFIG_DIR

    # Load the cloud configuration
    overrides = load_config(
        path,
        env_var,
        os.path.join(config_dir, 'cloud')
    )

    if defaults is None:
        defaults = DEFAULT_CLOUD_OPTS.copy()

    # Set defaults early to override Salt Master's default config values later
    defaults.update(overrides)
    overrides = defaults

    # Load cloud configuration from any default or provided includes
    overrides.update(
        salt.config.include_config(overrides['default_include'], config_dir, verbose=False)
    )
    include = overrides.get('include', [])
    overrides.update(
        salt.config.include_config(include, config_dir, verbose=True)
    )

    # The includes have been evaluated, let's see if master, providers and
    # profiles configuration settings have been included and if not, set the
    # default value
    if 'master_config' in overrides and master_config_path is None:
        # The configuration setting is being specified in the main cloud
        # configuration file
        master_config_path = overrides['master_config']
    elif 'master_config' not in overrides and not master_config \
            and not master_config_path:
        # The configuration setting is not being provided in the main cloud
        # configuration file, and
        master_config_path = os.path.join(config_dir, 'master')

    # Convert relative to absolute paths if necessary
    master_config_path = _absolute_path(master_config_path, config_dir)

    if 'providers_config' in overrides and providers_config_path is None:
        # The configuration setting is being specified in the main cloud
        # configuration file
        providers_config_path = overrides['providers_config']
    elif 'providers_config' not in overrides and not providers_config \
            and not providers_config_path:
        providers_config_path = os.path.join(config_dir, 'cloud.providers')

    # Convert relative to absolute paths if necessary
    providers_config_path = _absolute_path(providers_config_path, config_dir)

    if 'profiles_config' in overrides and profiles_config_path is None:
        # The configuration setting is being specified in the main cloud
        # configuration file
        profiles_config_path = overrides['profiles_config']
    elif 'profiles_config' not in overrides and not profiles_config \
            and not profiles_config_path:
        profiles_config_path = os.path.join(config_dir, 'cloud.profiles')

    # Convert relative to absolute paths if necessary
    profiles_config_path = _absolute_path(profiles_config_path, config_dir)

    # Prepare the deploy scripts search path
    deploy_scripts_search_path = overrides.get(
        'deploy_scripts_search_path',
        defaults.get('deploy_scripts_search_path', 'cloud.deploy.d')
    )
    if isinstance(deploy_scripts_search_path, six.string_types):
        deploy_scripts_search_path = [deploy_scripts_search_path]

    # Check the provided deploy scripts search path removing any non existing
    # entries.
    for idx, entry in enumerate(deploy_scripts_search_path[:]):
        if not os.path.isabs(entry):
            # Let's try adding the provided path's directory name turns the
            # entry into a proper directory
            entry = os.path.join(config_dir, entry)

        if os.path.isdir(entry):
            # Path exists, let's update the entry (its path might have been
            # made absolute)
            deploy_scripts_search_path[idx] = entry
            continue

        # It's not a directory? Remove it from the search path
        deploy_scripts_search_path.pop(idx)

    # Add the built-in scripts directory to the search path (last resort)
    deploy_scripts_search_path.append(
        os.path.abspath(
            os.path.join(
                os.path.dirname(__file__),
                '..',
                'cloud',
                'deploy'
            )
        )
    )

    # Let's make the search path a tuple and add it to the overrides.
    overrides.update(
        deploy_scripts_search_path=tuple(deploy_scripts_search_path)
    )

    # Grab data from the 4 sources
    # 1st - Master config
    if master_config_path is not None and master_config is not None:
        raise salt.exceptions.SaltCloudConfigError(
            'Only pass `master_config` or `master_config_path`, not both.'
        )
    elif master_config_path is None and master_config is None:
        master_config = salt.config.master_config(
            overrides.get(
                # use the value from the cloud config file
                'master_config',
                # if not found, use the default path
                os.path.join(salt.syspaths.CONFIG_DIR, 'master')
            )
        )
    elif master_config_path is not None and master_config is None:
        master_config = salt.config.master_config(master_config_path)

    # cloud config has a separate cachedir
    del master_config['cachedir']

    # 2nd - salt-cloud configuration which was loaded before so we could
    # extract the master configuration file if needed.

    # Override master configuration with the salt cloud(current overrides)
    master_config.update(overrides)
    # We now set the overridden master_config as the overrides
    overrides = master_config

    if providers_config_path is not None and providers_config is not None:
        raise salt.exceptions.SaltCloudConfigError(
            'Only pass `providers_config` or `providers_config_path`, '
            'not both.'
        )
    elif providers_config_path is None and providers_config is None:
        providers_config_path = overrides.get(
            # use the value from the cloud config file
            'providers_config',
            # if not found, use the default path
            os.path.join(salt.syspaths.CONFIG_DIR, 'cloud.providers')
        )

    if profiles_config_path is not None and profiles_config is not None:
        raise salt.exceptions.SaltCloudConfigError(
            'Only pass `profiles_config` or `profiles_config_path`, not both.'
        )
    elif profiles_config_path is None and profiles_config is None:
        profiles_config_path = overrides.get(
            # use the value from the cloud config file
            'profiles_config',
            # if not found, use the default path
            os.path.join(salt.syspaths.CONFIG_DIR, 'cloud.profiles')
        )

    # Apply the salt-cloud configuration
    opts = apply_cloud_config(overrides, defaults)

    # 3rd - Include Cloud Providers
    if 'providers' in opts:
        if providers_config is not None:
            raise salt.exceptions.SaltCloudConfigError(
                'Do not mix the old cloud providers configuration with '
                'the passing a pre-configured providers configuration '
                'dictionary.'
            )

        if providers_config_path is not None:
            providers_confd = os.path.join(
                os.path.dirname(providers_config_path),
                'cloud.providers.d', '*'
            )

            if (os.path.isfile(providers_config_path) or
                    glob.glob(providers_confd)):
                raise salt.exceptions.SaltCloudConfigError(
                    'Do not mix the old cloud providers configuration with '
                    'the new one. The providers configuration should now go '
                    'in the file `{0}` or a separate `*.conf` file within '
                    '`cloud.providers.d/` which is relative to `{0}`.'.format(
                        os.path.join(salt.syspaths.CONFIG_DIR, 'cloud.providers')
                    )
                )
        # No exception was raised? It's the old configuration alone
        providers_config = opts['providers']

    elif providers_config_path is not None:
        # Load from configuration file, even if that files does not exist since
        # it will be populated with defaults.
        providers_config = cloud_providers_config(providers_config_path)

    # Let's assign back the computed providers configuration
    opts['providers'] = providers_config

    # 4th - Include VM profiles config
    if profiles_config is None:
        # Load profiles configuration from the provided file
        profiles_config = vm_profiles_config(profiles_config_path,
                                             providers_config)
    opts['profiles'] = profiles_config

    # recurse opts for sdb configs
    apply_sdb(opts)

    # prepend root_dir
    prepend_root_dirs = ['cachedir']
    if 'log_file' in opts and urlparse(opts['log_file']).scheme == '':
        prepend_root_dirs.append(opts['log_file'])
    prepend_root_dir(opts, prepend_root_dirs)

    # Return the final options
    return opts
784295
public function register()
    {
        $this->mergeConfigFrom($this->originalConfigPath(), 'soundcloud');

        $config = $this->app['config'];
        $apiConfig = $config['services']['soundcloud'];
        $config = $config['soundcloud'];

        $this->registerSoundcloudFacade($apiConfig, $config);
    }