id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
56,000
INM-6/hybridLFPy
hybridLFPy/population.py
Population.get_all_synDelays
def get_all_synDelays(self): """ Create and load arrays of connection delays per connection on this rank Get random normally distributed synaptic delays, returns dict of nested list of same shape as SpCells. Delays are rounded to dt. This function takes no kwargs. ...
python
def get_all_synDelays(self): """ Create and load arrays of connection delays per connection on this rank Get random normally distributed synaptic delays, returns dict of nested list of same shape as SpCells. Delays are rounded to dt. This function takes no kwargs. ...
[ "def", "get_all_synDelays", "(", "self", ")", ":", "tic", "=", "time", "(", ")", "#ok then, we will draw random numbers across ranks, which have to", "#be unique per cell. Now, we simply record the random state,", "#change the seed per cell, and put the original state back below.", "rand...
Create and load arrays of connection delays per connection on this rank Get random normally distributed synaptic delays, returns dict of nested list of same shape as SpCells. Delays are rounded to dt. This function takes no kwargs. Parameters ---------- None ...
[ "Create", "and", "load", "arrays", "of", "connection", "delays", "per", "connection", "on", "this", "rank" ]
c38bdf38982c4624c2f70caeb50c40f1d5980abd
https://github.com/INM-6/hybridLFPy/blob/c38bdf38982c4624c2f70caeb50c40f1d5980abd/hybridLFPy/population.py#L1087-L1156
56,001
INM-6/hybridLFPy
hybridLFPy/population.py
Population.get_synidx
def get_synidx(self, cellindex): """ Local function, draw and return synapse locations corresponding to a single cell, using a random seed set as `POPULATIONSEED` + `cellindex`. Parameters ---------- cellindex : int Index of cell object. Re...
python
def get_synidx(self, cellindex): """ Local function, draw and return synapse locations corresponding to a single cell, using a random seed set as `POPULATIONSEED` + `cellindex`. Parameters ---------- cellindex : int Index of cell object. Re...
[ "def", "get_synidx", "(", "self", ",", "cellindex", ")", ":", "#create a cell instance", "cell", "=", "self", ".", "cellsim", "(", "cellindex", ",", "return_just_cell", "=", "True", ")", "#local containers", "synidx", "=", "{", "}", "#get synaptic placements and c...
Local function, draw and return synapse locations corresponding to a single cell, using a random seed set as `POPULATIONSEED` + `cellindex`. Parameters ---------- cellindex : int Index of cell object. Returns ------- synidx : dict ...
[ "Local", "function", "draw", "and", "return", "synapse", "locations", "corresponding", "to", "a", "single", "cell", "using", "a", "random", "seed", "set", "as", "POPULATIONSEED", "+", "cellindex", "." ]
c38bdf38982c4624c2f70caeb50c40f1d5980abd
https://github.com/INM-6/hybridLFPy/blob/c38bdf38982c4624c2f70caeb50c40f1d5980abd/hybridLFPy/population.py#L1159-L1197
56,002
INM-6/hybridLFPy
hybridLFPy/population.py
Population.fetchSynIdxCell
def fetchSynIdxCell(self, cell, nidx, synParams): """ Find possible synaptic placements for each cell As synapses are placed within layers with bounds determined by self.layerBoundaries, it will check this matrix accordingly, and use the probabilities from `self.connProbLayer to ...
python
def fetchSynIdxCell(self, cell, nidx, synParams): """ Find possible synaptic placements for each cell As synapses are placed within layers with bounds determined by self.layerBoundaries, it will check this matrix accordingly, and use the probabilities from `self.connProbLayer to ...
[ "def", "fetchSynIdxCell", "(", "self", ",", "cell", ",", "nidx", ",", "synParams", ")", ":", "#segment indices in each layer is stored here, list of np.array", "syn_idx", "=", "[", "]", "#loop over layer bounds, find synapse locations", "for", "i", ",", "zz", "in", "enu...
Find possible synaptic placements for each cell As synapses are placed within layers with bounds determined by self.layerBoundaries, it will check this matrix accordingly, and use the probabilities from `self.connProbLayer to distribute. For each layer, the synapses are placed with prob...
[ "Find", "possible", "synaptic", "placements", "for", "each", "cell", "As", "synapses", "are", "placed", "within", "layers", "with", "bounds", "determined", "by", "self", ".", "layerBoundaries", "it", "will", "check", "this", "matrix", "accordingly", "and", "use"...
c38bdf38982c4624c2f70caeb50c40f1d5980abd
https://github.com/INM-6/hybridLFPy/blob/c38bdf38982c4624c2f70caeb50c40f1d5980abd/hybridLFPy/population.py#L1200-L1244
56,003
INM-6/hybridLFPy
hybridLFPy/population.py
Population.cellsim
def cellsim(self, cellindex, return_just_cell = False): """ Do the actual simulations of LFP, using synaptic spike times from network simulation. Parameters ---------- cellindex : int cell index between 0 and population size-1. return_just_cell : boo...
python
def cellsim(self, cellindex, return_just_cell = False): """ Do the actual simulations of LFP, using synaptic spike times from network simulation. Parameters ---------- cellindex : int cell index between 0 and population size-1. return_just_cell : boo...
[ "def", "cellsim", "(", "self", ",", "cellindex", ",", "return_just_cell", "=", "False", ")", ":", "tic", "=", "time", "(", ")", "cell", "=", "LFPy", ".", "Cell", "(", "*", "*", "self", ".", "cellParams", ")", "cell", ".", "set_pos", "(", "*", "*", ...
Do the actual simulations of LFP, using synaptic spike times from network simulation. Parameters ---------- cellindex : int cell index between 0 and population size-1. return_just_cell : bool If True, return only the `LFPy.Cell` object if Fal...
[ "Do", "the", "actual", "simulations", "of", "LFP", "using", "synaptic", "spike", "times", "from", "network", "simulation", "." ]
c38bdf38982c4624c2f70caeb50c40f1d5980abd
https://github.com/INM-6/hybridLFPy/blob/c38bdf38982c4624c2f70caeb50c40f1d5980abd/hybridLFPy/population.py#L1246-L1331
56,004
INM-6/hybridLFPy
hybridLFPy/population.py
Population.insert_all_synapses
def insert_all_synapses(self, cellindex, cell): """ Insert all synaptic events from all presynaptic layers on cell object with index `cellindex`. Parameters ---------- cellindex : int cell index in the population. cell : `LFPy.Cell` instance ...
python
def insert_all_synapses(self, cellindex, cell): """ Insert all synaptic events from all presynaptic layers on cell object with index `cellindex`. Parameters ---------- cellindex : int cell index in the population. cell : `LFPy.Cell` instance ...
[ "def", "insert_all_synapses", "(", "self", ",", "cellindex", ",", "cell", ")", ":", "for", "i", ",", "X", "in", "enumerate", "(", "self", ".", "X", ")", ":", "#range(self.k_yXL.shape[1]):", "synParams", "=", "self", ".", "synParams", "synParams", ".", "upd...
Insert all synaptic events from all presynaptic layers on cell object with index `cellindex`. Parameters ---------- cellindex : int cell index in the population. cell : `LFPy.Cell` instance Postsynaptic target cell. Returns ------- ...
[ "Insert", "all", "synaptic", "events", "from", "all", "presynaptic", "layers", "on", "cell", "object", "with", "index", "cellindex", "." ]
c38bdf38982c4624c2f70caeb50c40f1d5980abd
https://github.com/INM-6/hybridLFPy/blob/c38bdf38982c4624c2f70caeb50c40f1d5980abd/hybridLFPy/population.py#L1334-L1376
56,005
INM-6/hybridLFPy
hybridLFPy/population.py
Population.insert_synapses
def insert_synapses(self, cell, cellindex, synParams, idx = np.array([]), X='EX', SpCell = np.array([]), synDelays = None): """ Insert synapse with `parameters`=`synparams` on cell=cell, with segment indexes given by `idx`. `SpCell` and `SpTimes` p...
python
def insert_synapses(self, cell, cellindex, synParams, idx = np.array([]), X='EX', SpCell = np.array([]), synDelays = None): """ Insert synapse with `parameters`=`synparams` on cell=cell, with segment indexes given by `idx`. `SpCell` and `SpTimes` p...
[ "def", "insert_synapses", "(", "self", ",", "cell", ",", "cellindex", ",", "synParams", ",", "idx", "=", "np", ".", "array", "(", "[", "]", ")", ",", "X", "=", "'EX'", ",", "SpCell", "=", "np", ".", "array", "(", "[", "]", ")", ",", "synDelays", ...
Insert synapse with `parameters`=`synparams` on cell=cell, with segment indexes given by `idx`. `SpCell` and `SpTimes` picked from Brunel network simulation Parameters ---------- cell : `LFPy.Cell` instance Postsynaptic target cell. cellindex : int ...
[ "Insert", "synapse", "with", "parameters", "=", "synparams", "on", "cell", "=", "cell", "with", "segment", "indexes", "given", "by", "idx", ".", "SpCell", "and", "SpTimes", "picked", "from", "Brunel", "network", "simulation" ]
c38bdf38982c4624c2f70caeb50c40f1d5980abd
https://github.com/INM-6/hybridLFPy/blob/c38bdf38982c4624c2f70caeb50c40f1d5980abd/hybridLFPy/population.py#L1379-L1439
56,006
alpha-xone/xone
xone/procs.py
run
def run(func, keys, max_procs=None, show_proc=False, affinity=None, **kwargs): """ Provide interface for multiprocessing Args: func: callable functions keys: keys in kwargs that want to use process max_procs: max number of processes show_proc: whether to show process ...
python
def run(func, keys, max_procs=None, show_proc=False, affinity=None, **kwargs): """ Provide interface for multiprocessing Args: func: callable functions keys: keys in kwargs that want to use process max_procs: max number of processes show_proc: whether to show process ...
[ "def", "run", "(", "func", ",", "keys", ",", "max_procs", "=", "None", ",", "show_proc", "=", "False", ",", "affinity", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "max_procs", "is", "None", ":", "max_procs", "=", "cpu_count", "(", ")", "...
Provide interface for multiprocessing Args: func: callable functions keys: keys in kwargs that want to use process max_procs: max number of processes show_proc: whether to show process affinity: CPU affinity **kwargs: kwargs for func
[ "Provide", "interface", "for", "multiprocessing" ]
68534a30f7f1760b220ba58040be3927f7dfbcf4
https://github.com/alpha-xone/xone/blob/68534a30f7f1760b220ba58040be3927f7dfbcf4/xone/procs.py#L16-L49
56,007
alpha-xone/xone
xone/procs.py
saturate_kwargs
def saturate_kwargs(keys, **kwargs): """ Saturate all combinations of kwargs Args: keys: keys in kwargs that want to use process **kwargs: kwargs for func """ # Validate if keys are in kwargs and if they are iterable if isinstance(keys, str): keys = [keys] keys = [k for k in...
python
def saturate_kwargs(keys, **kwargs): """ Saturate all combinations of kwargs Args: keys: keys in kwargs that want to use process **kwargs: kwargs for func """ # Validate if keys are in kwargs and if they are iterable if isinstance(keys, str): keys = [keys] keys = [k for k in...
[ "def", "saturate_kwargs", "(", "keys", ",", "*", "*", "kwargs", ")", ":", "# Validate if keys are in kwargs and if they are iterable", "if", "isinstance", "(", "keys", ",", "str", ")", ":", "keys", "=", "[", "keys", "]", "keys", "=", "[", "k", "for", "k", ...
Saturate all combinations of kwargs Args: keys: keys in kwargs that want to use process **kwargs: kwargs for func
[ "Saturate", "all", "combinations", "of", "kwargs" ]
68534a30f7f1760b220ba58040be3927f7dfbcf4
https://github.com/alpha-xone/xone/blob/68534a30f7f1760b220ba58040be3927f7dfbcf4/xone/procs.py#L52-L78
56,008
mthh/smoomapy
smoomapy/core.py
quick_idw
def quick_idw(input_geojson_points, variable_name, power, nb_class, nb_pts=10000, resolution=None, disc_func=None, mask=None, user_defined_breaks=None, variable_name2=None, output='GeoJSON', **kwargs): """ Function acting as a one-shot wrapper around SmoothIdw object. ...
python
def quick_idw(input_geojson_points, variable_name, power, nb_class, nb_pts=10000, resolution=None, disc_func=None, mask=None, user_defined_breaks=None, variable_name2=None, output='GeoJSON', **kwargs): """ Function acting as a one-shot wrapper around SmoothIdw object. ...
[ "def", "quick_idw", "(", "input_geojson_points", ",", "variable_name", ",", "power", ",", "nb_class", ",", "nb_pts", "=", "10000", ",", "resolution", "=", "None", ",", "disc_func", "=", "None", ",", "mask", "=", "None", ",", "user_defined_breaks", "=", "None...
Function acting as a one-shot wrapper around SmoothIdw object. Read a file of point values and optionnaly a mask file, return the smoothed representation as GeoJSON or GeoDataFrame. Parameters ---------- input_geojson_points : str Path to file to use as input (Points/Polygons) or GeoDataFra...
[ "Function", "acting", "as", "a", "one", "-", "shot", "wrapper", "around", "SmoothIdw", "object", ".", "Read", "a", "file", "of", "point", "values", "and", "optionnaly", "a", "mask", "file", "return", "the", "smoothed", "representation", "as", "GeoJSON", "or"...
a603a62e76592e84509591fddcde8bfb1e826b84
https://github.com/mthh/smoomapy/blob/a603a62e76592e84509591fddcde8bfb1e826b84/smoomapy/core.py#L23-L99
56,009
mthh/smoomapy
smoomapy/core.py
quick_stewart
def quick_stewart(input_geojson_points, variable_name, span, beta=2, typefct='exponential',nb_class=None, nb_pts=10000, resolution=None, mask=None, user_defined_breaks=None, variable_name2=None, output="GeoJSON", **kwargs): """ Function act...
python
def quick_stewart(input_geojson_points, variable_name, span, beta=2, typefct='exponential',nb_class=None, nb_pts=10000, resolution=None, mask=None, user_defined_breaks=None, variable_name2=None, output="GeoJSON", **kwargs): """ Function act...
[ "def", "quick_stewart", "(", "input_geojson_points", ",", "variable_name", ",", "span", ",", "beta", "=", "2", ",", "typefct", "=", "'exponential'", ",", "nb_class", "=", "None", ",", "nb_pts", "=", "10000", ",", "resolution", "=", "None", ",", "mask", "="...
Function acting as a one-shot wrapper around SmoothStewart object. Read a file of point values and optionnaly a mask file, return the smoothed representation as GeoJSON or GeoDataFrame. Parameters ---------- input_geojson_points : str Path to file to use as input (Points/Polygons) or GeoDat...
[ "Function", "acting", "as", "a", "one", "-", "shot", "wrapper", "around", "SmoothStewart", "object", ".", "Read", "a", "file", "of", "point", "values", "and", "optionnaly", "a", "mask", "file", "return", "the", "smoothed", "representation", "as", "GeoJSON", ...
a603a62e76592e84509591fddcde8bfb1e826b84
https://github.com/mthh/smoomapy/blob/a603a62e76592e84509591fddcde8bfb1e826b84/smoomapy/core.py#L101-L181
56,010
mthh/smoomapy
smoomapy/core.py
make_regular_points
def make_regular_points(bounds, resolution, longlat=True): """ Return a regular grid of points within `bounds` with the specified resolution. Parameters ---------- bounds : 4-floats tuple The bbox of the grid, as xmin, ymin, xmax, ymax. resolution : int The resolution to use...
python
def make_regular_points(bounds, resolution, longlat=True): """ Return a regular grid of points within `bounds` with the specified resolution. Parameters ---------- bounds : 4-floats tuple The bbox of the grid, as xmin, ymin, xmax, ymax. resolution : int The resolution to use...
[ "def", "make_regular_points", "(", "bounds", ",", "resolution", ",", "longlat", "=", "True", ")", ":", "# xmin, ymin, xmax, ymax = bounds", "minlon", ",", "minlat", ",", "maxlon", ",", "maxlat", "=", "bounds", "offset_lon", "=", "(", "maxlon", "-", "minlon", ...
Return a regular grid of points within `bounds` with the specified resolution. Parameters ---------- bounds : 4-floats tuple The bbox of the grid, as xmin, ymin, xmax, ymax. resolution : int The resolution to use, in the same unit as `bounds` Returns ------- points : nu...
[ "Return", "a", "regular", "grid", "of", "points", "within", "bounds", "with", "the", "specified", "resolution", "." ]
a603a62e76592e84509591fddcde8bfb1e826b84
https://github.com/mthh/smoomapy/blob/a603a62e76592e84509591fddcde8bfb1e826b84/smoomapy/core.py#L222-L277
56,011
tsroten/hanzidentifier
hanzidentifier.py
identify
def identify(s): """Identify what kind of Chinese characters a string contains. *s* is a string to examine. The string's Chinese characters are tested to see if they are compatible with the Traditional or Simplified characters systems, compatible with both, or contain a mixture of Traditional and S...
python
def identify(s): """Identify what kind of Chinese characters a string contains. *s* is a string to examine. The string's Chinese characters are tested to see if they are compatible with the Traditional or Simplified characters systems, compatible with both, or contain a mixture of Traditional and S...
[ "def", "identify", "(", "s", ")", ":", "chinese", "=", "_get_hanzi", "(", "s", ")", "if", "not", "chinese", ":", "return", "UNKNOWN", "if", "chinese", ".", "issubset", "(", "_SHARED_CHARACTERS", ")", ":", "return", "BOTH", "if", "chinese", ".", "issubset...
Identify what kind of Chinese characters a string contains. *s* is a string to examine. The string's Chinese characters are tested to see if they are compatible with the Traditional or Simplified characters systems, compatible with both, or contain a mixture of Traditional and Simplified characters. Th...
[ "Identify", "what", "kind", "of", "Chinese", "characters", "a", "string", "contains", "." ]
40b565222363f5582fd06dc14833d2b86f09fa35
https://github.com/tsroten/hanzidentifier/blob/40b565222363f5582fd06dc14833d2b86f09fa35/hanzidentifier.py#L27-L58
56,012
tsroten/hanzidentifier
hanzidentifier.py
is_traditional
def is_traditional(s): """Check if a string's Chinese characters are Traditional. This is equivalent to: >>> identify('foo') in (TRADITIONAL, BOTH) """ chinese = _get_hanzi(s) if not chinese: return False elif chinese.issubset(_SHARED_CHARACTERS): return True elif c...
python
def is_traditional(s): """Check if a string's Chinese characters are Traditional. This is equivalent to: >>> identify('foo') in (TRADITIONAL, BOTH) """ chinese = _get_hanzi(s) if not chinese: return False elif chinese.issubset(_SHARED_CHARACTERS): return True elif c...
[ "def", "is_traditional", "(", "s", ")", ":", "chinese", "=", "_get_hanzi", "(", "s", ")", "if", "not", "chinese", ":", "return", "False", "elif", "chinese", ".", "issubset", "(", "_SHARED_CHARACTERS", ")", ":", "return", "True", "elif", "chinese", ".", "...
Check if a string's Chinese characters are Traditional. This is equivalent to: >>> identify('foo') in (TRADITIONAL, BOTH)
[ "Check", "if", "a", "string", "s", "Chinese", "characters", "are", "Traditional", "." ]
40b565222363f5582fd06dc14833d2b86f09fa35
https://github.com/tsroten/hanzidentifier/blob/40b565222363f5582fd06dc14833d2b86f09fa35/hanzidentifier.py#L71-L85
56,013
tsroten/hanzidentifier
hanzidentifier.py
is_simplified
def is_simplified(s): """Check if a string's Chinese characters are Simplified. This is equivalent to: >>> identify('foo') in (SIMPLIFIED, BOTH) """ chinese = _get_hanzi(s) if not chinese: return False elif chinese.issubset(_SHARED_CHARACTERS): return True elif chin...
python
def is_simplified(s): """Check if a string's Chinese characters are Simplified. This is equivalent to: >>> identify('foo') in (SIMPLIFIED, BOTH) """ chinese = _get_hanzi(s) if not chinese: return False elif chinese.issubset(_SHARED_CHARACTERS): return True elif chin...
[ "def", "is_simplified", "(", "s", ")", ":", "chinese", "=", "_get_hanzi", "(", "s", ")", "if", "not", "chinese", ":", "return", "False", "elif", "chinese", ".", "issubset", "(", "_SHARED_CHARACTERS", ")", ":", "return", "True", "elif", "chinese", ".", "i...
Check if a string's Chinese characters are Simplified. This is equivalent to: >>> identify('foo') in (SIMPLIFIED, BOTH)
[ "Check", "if", "a", "string", "s", "Chinese", "characters", "are", "Simplified", "." ]
40b565222363f5582fd06dc14833d2b86f09fa35
https://github.com/tsroten/hanzidentifier/blob/40b565222363f5582fd06dc14833d2b86f09fa35/hanzidentifier.py#L88-L102
56,014
INM-6/hybridLFPy
examples/Hagen_et_al_2016_cercor/analysis_params.py
params.set_default_fig_style
def set_default_fig_style(self): '''default figure size''' plt.rcParams.update({ 'figure.figsize' : [self.frontierswidth/self.inchpercm, self.frontierswidth/self.inchpercm], })
python
def set_default_fig_style(self): '''default figure size''' plt.rcParams.update({ 'figure.figsize' : [self.frontierswidth/self.inchpercm, self.frontierswidth/self.inchpercm], })
[ "def", "set_default_fig_style", "(", "self", ")", ":", "plt", ".", "rcParams", ".", "update", "(", "{", "'figure.figsize'", ":", "[", "self", ".", "frontierswidth", "/", "self", ".", "inchpercm", ",", "self", ".", "frontierswidth", "/", "self", ".", "inchp...
default figure size
[ "default", "figure", "size" ]
c38bdf38982c4624c2f70caeb50c40f1d5980abd
https://github.com/INM-6/hybridLFPy/blob/c38bdf38982c4624c2f70caeb50c40f1d5980abd/examples/Hagen_et_al_2016_cercor/analysis_params.py#L92-L96
56,015
INM-6/hybridLFPy
examples/Hagen_et_al_2016_cercor/analysis_params.py
params.set_large_fig_style
def set_large_fig_style(self): '''twice width figure size''' plt.rcParams.update({ 'figure.figsize' : [self.frontierswidth/self.inchpercm*2, self.frontierswidth/self.inchpercm], })
python
def set_large_fig_style(self): '''twice width figure size''' plt.rcParams.update({ 'figure.figsize' : [self.frontierswidth/self.inchpercm*2, self.frontierswidth/self.inchpercm], })
[ "def", "set_large_fig_style", "(", "self", ")", ":", "plt", ".", "rcParams", ".", "update", "(", "{", "'figure.figsize'", ":", "[", "self", ".", "frontierswidth", "/", "self", ".", "inchpercm", "*", "2", ",", "self", ".", "frontierswidth", "/", "self", "...
twice width figure size
[ "twice", "width", "figure", "size" ]
c38bdf38982c4624c2f70caeb50c40f1d5980abd
https://github.com/INM-6/hybridLFPy/blob/c38bdf38982c4624c2f70caeb50c40f1d5980abd/examples/Hagen_et_al_2016_cercor/analysis_params.py#L99-L103
56,016
INM-6/hybridLFPy
examples/Hagen_et_al_2016_cercor/analysis_params.py
params.set_broad_fig_style
def set_broad_fig_style(self): '''4 times width, 1.5 times height''' plt.rcParams.update({ 'figure.figsize' : [self.frontierswidth/self.inchpercm*4, self.frontierswidth/self.inchpercm*1.5], })
python
def set_broad_fig_style(self): '''4 times width, 1.5 times height''' plt.rcParams.update({ 'figure.figsize' : [self.frontierswidth/self.inchpercm*4, self.frontierswidth/self.inchpercm*1.5], })
[ "def", "set_broad_fig_style", "(", "self", ")", ":", "plt", ".", "rcParams", ".", "update", "(", "{", "'figure.figsize'", ":", "[", "self", ".", "frontierswidth", "/", "self", ".", "inchpercm", "*", "4", ",", "self", ".", "frontierswidth", "/", "self", "...
4 times width, 1.5 times height
[ "4", "times", "width", "1", ".", "5", "times", "height" ]
c38bdf38982c4624c2f70caeb50c40f1d5980abd
https://github.com/INM-6/hybridLFPy/blob/c38bdf38982c4624c2f70caeb50c40f1d5980abd/examples/Hagen_et_al_2016_cercor/analysis_params.py#L105-L109
56,017
INM-6/hybridLFPy
examples/Hagen_et_al_2016_cercor/analysis_params.py
params.set_enormous_fig_style
def set_enormous_fig_style(self): '''2 times width, 2 times height''' plt.rcParams.update({ 'figure.figsize' : [self.frontierswidth/self.inchpercm*2, self.frontierswidth/self.inchpercm*2], })
python
def set_enormous_fig_style(self): '''2 times width, 2 times height''' plt.rcParams.update({ 'figure.figsize' : [self.frontierswidth/self.inchpercm*2, self.frontierswidth/self.inchpercm*2], })
[ "def", "set_enormous_fig_style", "(", "self", ")", ":", "plt", ".", "rcParams", ".", "update", "(", "{", "'figure.figsize'", ":", "[", "self", ".", "frontierswidth", "/", "self", ".", "inchpercm", "*", "2", ",", "self", ".", "frontierswidth", "/", "self", ...
2 times width, 2 times height
[ "2", "times", "width", "2", "times", "height" ]
c38bdf38982c4624c2f70caeb50c40f1d5980abd
https://github.com/INM-6/hybridLFPy/blob/c38bdf38982c4624c2f70caeb50c40f1d5980abd/examples/Hagen_et_al_2016_cercor/analysis_params.py#L112-L117
56,018
INM-6/hybridLFPy
examples/Hagen_et_al_2016_cercor/analysis_params.py
params.set_PLOS_1column_fig_style
def set_PLOS_1column_fig_style(self, ratio=1): '''figure size corresponding to Plos 1 column''' plt.rcParams.update({ 'figure.figsize' : [self.PLOSwidth1Col,self.PLOSwidth1Col*ratio], })
python
def set_PLOS_1column_fig_style(self, ratio=1): '''figure size corresponding to Plos 1 column''' plt.rcParams.update({ 'figure.figsize' : [self.PLOSwidth1Col,self.PLOSwidth1Col*ratio], })
[ "def", "set_PLOS_1column_fig_style", "(", "self", ",", "ratio", "=", "1", ")", ":", "plt", ".", "rcParams", ".", "update", "(", "{", "'figure.figsize'", ":", "[", "self", ".", "PLOSwidth1Col", ",", "self", ".", "PLOSwidth1Col", "*", "ratio", "]", ",", "}...
figure size corresponding to Plos 1 column
[ "figure", "size", "corresponding", "to", "Plos", "1", "column" ]
c38bdf38982c4624c2f70caeb50c40f1d5980abd
https://github.com/INM-6/hybridLFPy/blob/c38bdf38982c4624c2f70caeb50c40f1d5980abd/examples/Hagen_et_al_2016_cercor/analysis_params.py#L120-L124
56,019
INM-6/hybridLFPy
examples/Hagen_et_al_2016_cercor/analysis_params.py
params.set_PLOS_2column_fig_style
def set_PLOS_2column_fig_style(self, ratio=1): '''figure size corresponding to Plos 2 columns''' plt.rcParams.update({ 'figure.figsize' : [self.PLOSwidth2Col, self.PLOSwidth2Col*ratio], })
python
def set_PLOS_2column_fig_style(self, ratio=1): '''figure size corresponding to Plos 2 columns''' plt.rcParams.update({ 'figure.figsize' : [self.PLOSwidth2Col, self.PLOSwidth2Col*ratio], })
[ "def", "set_PLOS_2column_fig_style", "(", "self", ",", "ratio", "=", "1", ")", ":", "plt", ".", "rcParams", ".", "update", "(", "{", "'figure.figsize'", ":", "[", "self", ".", "PLOSwidth2Col", ",", "self", ".", "PLOSwidth2Col", "*", "ratio", "]", ",", "}...
figure size corresponding to Plos 2 columns
[ "figure", "size", "corresponding", "to", "Plos", "2", "columns" ]
c38bdf38982c4624c2f70caeb50c40f1d5980abd
https://github.com/INM-6/hybridLFPy/blob/c38bdf38982c4624c2f70caeb50c40f1d5980abd/examples/Hagen_et_al_2016_cercor/analysis_params.py#L127-L131
56,020
INM-6/hybridLFPy
hybridLFPy/postproc.py
PostProcess.run
def run(self): """ Perform the postprocessing steps, computing compound signals from cell-specific output files. """ if RANK == 0: if 'LFP' in self.savelist: #get the per population LFPs and total LFP from all populations: self.LFPdict, self.LF...
python
def run(self): """ Perform the postprocessing steps, computing compound signals from cell-specific output files. """ if RANK == 0: if 'LFP' in self.savelist: #get the per population LFPs and total LFP from all populations: self.LFPdict, self.LF...
[ "def", "run", "(", "self", ")", ":", "if", "RANK", "==", "0", ":", "if", "'LFP'", "in", "self", ".", "savelist", ":", "#get the per population LFPs and total LFP from all populations:", "self", ".", "LFPdict", ",", "self", ".", "LFPsum", "=", "self", ".", "c...
Perform the postprocessing steps, computing compound signals from cell-specific output files.
[ "Perform", "the", "postprocessing", "steps", "computing", "compound", "signals", "from", "cell", "-", "specific", "output", "files", "." ]
c38bdf38982c4624c2f70caeb50c40f1d5980abd
https://github.com/INM-6/hybridLFPy/blob/c38bdf38982c4624c2f70caeb50c40f1d5980abd/hybridLFPy/postproc.py#L104-L154
56,021
INM-6/hybridLFPy
hybridLFPy/postproc.py
PostProcess.calc_lfp
def calc_lfp(self): """ Sum all the LFP contributions from every cell type. """ LFParray = np.array([]) LFPdict = {} i = 0 for y in self.y: fil = os.path.join(self.populations_path, self.output_file.format(y, 'LFP.h5')) ...
python
def calc_lfp(self): """ Sum all the LFP contributions from every cell type. """ LFParray = np.array([]) LFPdict = {} i = 0 for y in self.y: fil = os.path.join(self.populations_path, self.output_file.format(y, 'LFP.h5')) ...
[ "def", "calc_lfp", "(", "self", ")", ":", "LFParray", "=", "np", ".", "array", "(", "[", "]", ")", "LFPdict", "=", "{", "}", "i", "=", "0", "for", "y", "in", "self", ".", "y", ":", "fil", "=", "os", ".", "path", ".", "join", "(", "self", "....
Sum all the LFP contributions from every cell type.
[ "Sum", "all", "the", "LFP", "contributions", "from", "every", "cell", "type", "." ]
c38bdf38982c4624c2f70caeb50c40f1d5980abd
https://github.com/INM-6/hybridLFPy/blob/c38bdf38982c4624c2f70caeb50c40f1d5980abd/hybridLFPy/postproc.py#L173-L200
56,022
INM-6/hybridLFPy
hybridLFPy/postproc.py
PostProcess.calc_csd
def calc_csd(self): """ Sum all the CSD contributions from every layer. """ CSDarray = np.array([]) CSDdict = {} i = 0 for y in self.y: fil = os.path.join(self.populations_path, self.output_file.format(y, 'CSD.h5')) ...
python
def calc_csd(self): """ Sum all the CSD contributions from every layer. """ CSDarray = np.array([]) CSDdict = {} i = 0 for y in self.y: fil = os.path.join(self.populations_path, self.output_file.format(y, 'CSD.h5')) ...
[ "def", "calc_csd", "(", "self", ")", ":", "CSDarray", "=", "np", ".", "array", "(", "[", "]", ")", "CSDdict", "=", "{", "}", "i", "=", "0", "for", "y", "in", "self", ".", "y", ":", "fil", "=", "os", ".", "path", ".", "join", "(", "self", "....
Sum all the CSD contributions from every layer.
[ "Sum", "all", "the", "CSD", "contributions", "from", "every", "layer", "." ]
c38bdf38982c4624c2f70caeb50c40f1d5980abd
https://github.com/INM-6/hybridLFPy/blob/c38bdf38982c4624c2f70caeb50c40f1d5980abd/hybridLFPy/postproc.py#L203-L230
56,023
INM-6/hybridLFPy
hybridLFPy/postproc.py
PostProcess.create_tar_archive
def create_tar_archive(self): """ Create a tar archive of the main simulation outputs. """ #file filter EXCLUDE_FILES = glob.glob(os.path.join(self.savefolder, 'cells')) EXCLUDE_FILES += glob.glob(os.path.join(self.savefolder, 'popu...
python
def create_tar_archive(self): """ Create a tar archive of the main simulation outputs. """ #file filter EXCLUDE_FILES = glob.glob(os.path.join(self.savefolder, 'cells')) EXCLUDE_FILES += glob.glob(os.path.join(self.savefolder, 'popu...
[ "def", "create_tar_archive", "(", "self", ")", ":", "#file filter", "EXCLUDE_FILES", "=", "glob", ".", "glob", "(", "os", ".", "path", ".", "join", "(", "self", ".", "savefolder", ",", "'cells'", ")", ")", "EXCLUDE_FILES", "+=", "glob", ".", "glob", "(",...
Create a tar archive of the main simulation outputs.
[ "Create", "a", "tar", "archive", "of", "the", "main", "simulation", "outputs", "." ]
c38bdf38982c4624c2f70caeb50c40f1d5980abd
https://github.com/INM-6/hybridLFPy/blob/c38bdf38982c4624c2f70caeb50c40f1d5980abd/hybridLFPy/postproc.py#L283-L318
56,024
staticdev/django-sorting-bootstrap
sorting_bootstrap/sort.py
sort_queryset
def sort_queryset(queryset, request, context=None): """ Returns a sorted queryset The context argument is only used in the template tag """ sort_by = request.GET.get('sort_by') if sort_by: if sort_by in [el.name for el in queryset.model._meta.fields]: queryset = queryset.order_by...
python
def sort_queryset(queryset, request, context=None): """ Returns a sorted queryset The context argument is only used in the template tag """ sort_by = request.GET.get('sort_by') if sort_by: if sort_by in [el.name for el in queryset.model._meta.fields]: queryset = queryset.order_by...
[ "def", "sort_queryset", "(", "queryset", ",", "request", ",", "context", "=", "None", ")", ":", "sort_by", "=", "request", ".", "GET", ".", "get", "(", "'sort_by'", ")", "if", "sort_by", ":", "if", "sort_by", "in", "[", "el", ".", "name", "for", "el"...
Returns a sorted queryset The context argument is only used in the template tag
[ "Returns", "a", "sorted", "queryset", "The", "context", "argument", "is", "only", "used", "in", "the", "template", "tag" ]
cfdc6e671b1b57aad04e44b041b9df10ee8288d3
https://github.com/staticdev/django-sorting-bootstrap/blob/cfdc6e671b1b57aad04e44b041b9df10ee8288d3/sorting_bootstrap/sort.py#L1-L26
56,025
tkf/rash
rash/utils/iterutils.py
include_before
def include_before(predicate, num, iterative): """ Return elements in `iterative` including `num`-before elements. >>> list(include_before(lambda x: x == 'd', 2, 'abcded')) ['b', 'c', 'd', 'e', 'd'] """ (it0, it1) = itertools.tee(iterative) ps = _backward_shifted_predicate(predicate, num, ...
python
def include_before(predicate, num, iterative): """ Return elements in `iterative` including `num`-before elements. >>> list(include_before(lambda x: x == 'd', 2, 'abcded')) ['b', 'c', 'd', 'e', 'd'] """ (it0, it1) = itertools.tee(iterative) ps = _backward_shifted_predicate(predicate, num, ...
[ "def", "include_before", "(", "predicate", ",", "num", ",", "iterative", ")", ":", "(", "it0", ",", "it1", ")", "=", "itertools", ".", "tee", "(", "iterative", ")", "ps", "=", "_backward_shifted_predicate", "(", "predicate", ",", "num", ",", "it1", ")", ...
Return elements in `iterative` including `num`-before elements. >>> list(include_before(lambda x: x == 'd', 2, 'abcded')) ['b', 'c', 'd', 'e', 'd']
[ "Return", "elements", "in", "iterative", "including", "num", "-", "before", "elements", "." ]
585da418ec37dd138f1a4277718b6f507e9536a2
https://github.com/tkf/rash/blob/585da418ec37dd138f1a4277718b6f507e9536a2/rash/utils/iterutils.py#L71-L81
56,026
tkf/rash
rash/utils/iterutils.py
include_after
def include_after(predicate, num, iterative): """ Return elements in `iterative` including `num`-after elements. >>> list(include_after(lambda x: x == 'b', 2, 'abcbcde')) ['b', 'c', 'b', 'c', 'd'] """ (it0, it1) = itertools.tee(iterative) ps = _forward_shifted_predicate(predicate, num, it1...
python
def include_after(predicate, num, iterative): """ Return elements in `iterative` including `num`-after elements. >>> list(include_after(lambda x: x == 'b', 2, 'abcbcde')) ['b', 'c', 'b', 'c', 'd'] """ (it0, it1) = itertools.tee(iterative) ps = _forward_shifted_predicate(predicate, num, it1...
[ "def", "include_after", "(", "predicate", ",", "num", ",", "iterative", ")", ":", "(", "it0", ",", "it1", ")", "=", "itertools", ".", "tee", "(", "iterative", ")", "ps", "=", "_forward_shifted_predicate", "(", "predicate", ",", "num", ",", "it1", ")", ...
Return elements in `iterative` including `num`-after elements. >>> list(include_after(lambda x: x == 'b', 2, 'abcbcde')) ['b', 'c', 'b', 'c', 'd']
[ "Return", "elements", "in", "iterative", "including", "num", "-", "after", "elements", "." ]
585da418ec37dd138f1a4277718b6f507e9536a2
https://github.com/tkf/rash/blob/585da418ec37dd138f1a4277718b6f507e9536a2/rash/utils/iterutils.py#L84-L94
56,027
tkf/rash
rash/utils/iterutils.py
include_context
def include_context(predicate, num, iterative): """ Return elements in `iterative` including `num` before and after elements. >>> ''.join(include_context(lambda x: x == '!', 2, 'bb!aa__bb!aa')) 'bb!aabb!aa' """ (it0, it1, it2) = itertools.tee(iterative, 3) psf = _forward_shifted_predicate(...
python
def include_context(predicate, num, iterative): """ Return elements in `iterative` including `num` before and after elements. >>> ''.join(include_context(lambda x: x == '!', 2, 'bb!aa__bb!aa')) 'bb!aabb!aa' """ (it0, it1, it2) = itertools.tee(iterative, 3) psf = _forward_shifted_predicate(...
[ "def", "include_context", "(", "predicate", ",", "num", ",", "iterative", ")", ":", "(", "it0", ",", "it1", ",", "it2", ")", "=", "itertools", ".", "tee", "(", "iterative", ",", "3", ")", "psf", "=", "_forward_shifted_predicate", "(", "predicate", ",", ...
Return elements in `iterative` including `num` before and after elements. >>> ''.join(include_context(lambda x: x == '!', 2, 'bb!aa__bb!aa')) 'bb!aabb!aa'
[ "Return", "elements", "in", "iterative", "including", "num", "before", "and", "after", "elements", "." ]
585da418ec37dd138f1a4277718b6f507e9536a2
https://github.com/tkf/rash/blob/585da418ec37dd138f1a4277718b6f507e9536a2/rash/utils/iterutils.py#L97-L108
56,028
INM-6/hybridLFPy
examples/Hagen_et_al_2016_cercor/analysis.py
calc_variances
def calc_variances(params): ''' This function calculates the variance of the sum signal and all population-resolved signals ''' depth = params.electrodeParams['z'] ############################ ### CSD ### ############################ for i, data_type in enumerate(['C...
python
def calc_variances(params): ''' This function calculates the variance of the sum signal and all population-resolved signals ''' depth = params.electrodeParams['z'] ############################ ### CSD ### ############################ for i, data_type in enumerate(['C...
[ "def", "calc_variances", "(", "params", ")", ":", "depth", "=", "params", ".", "electrodeParams", "[", "'z'", "]", "############################", "### CSD ###", "############################", "for", "i", ",", "data_type", "in", "enumerate", "(", "["...
This function calculates the variance of the sum signal and all population-resolved signals
[ "This", "function", "calculates", "the", "variance", "of", "the", "sum", "signal", "and", "all", "population", "-", "resolved", "signals" ]
c38bdf38982c4624c2f70caeb50c40f1d5980abd
https://github.com/INM-6/hybridLFPy/blob/c38bdf38982c4624c2f70caeb50c40f1d5980abd/examples/Hagen_et_al_2016_cercor/analysis.py#L319-L351
56,029
Pytwitcher/pytwitcherapi
docs/source/snippets/chat_myclient1.py
MyIRCClient.on_join
def on_join(self, connection, event): """Handles the join event and greets everone :param connection: the connection with the event :type connection: :class:`irc.client.ServerConnection` :param event: the event to handle :type event: :class:`irc.client.Event` :returns: N...
python
def on_join(self, connection, event): """Handles the join event and greets everone :param connection: the connection with the event :type connection: :class:`irc.client.ServerConnection` :param event: the event to handle :type event: :class:`irc.client.Event` :returns: N...
[ "def", "on_join", "(", "self", ",", "connection", ",", "event", ")", ":", "target", "=", "event", ".", "source", "self", ".", "privmsg", "(", "target", ",", "'Hello %s!'", "%", "target", ")" ]
Handles the join event and greets everone :param connection: the connection with the event :type connection: :class:`irc.client.ServerConnection` :param event: the event to handle :type event: :class:`irc.client.Event` :returns: None
[ "Handles", "the", "join", "event", "and", "greets", "everone" ]
d53ac5ad5ca113ecb7da542e8cdcbbf8c762b336
https://github.com/Pytwitcher/pytwitcherapi/blob/d53ac5ad5ca113ecb7da542e8cdcbbf8c762b336/docs/source/snippets/chat_myclient1.py#L5-L15
56,030
tkf/rash
rash/daemon.py
daemon_run
def daemon_run(no_error, restart, record_path, keep_json, check_duplicate, use_polling, log_level): """ Run RASH index daemon. This daemon watches the directory ``~/.config/rash/data/record`` and translate the JSON files dumped by ``record`` command into sqlite3 DB at ``~/.config/ras...
python
def daemon_run(no_error, restart, record_path, keep_json, check_duplicate, use_polling, log_level): """ Run RASH index daemon. This daemon watches the directory ``~/.config/rash/data/record`` and translate the JSON files dumped by ``record`` command into sqlite3 DB at ``~/.config/ras...
[ "def", "daemon_run", "(", "no_error", ",", "restart", ",", "record_path", ",", "keep_json", ",", "check_duplicate", ",", "use_polling", ",", "log_level", ")", ":", "# Probably it makes sense to use this daemon to provide search", "# API, so that this daemon is going to be the o...
Run RASH index daemon. This daemon watches the directory ``~/.config/rash/data/record`` and translate the JSON files dumped by ``record`` command into sqlite3 DB at ``~/.config/rash/data/db.sqlite``. ``rash init`` will start RASH automatically by default. But there are alternative ways to start da...
[ "Run", "RASH", "index", "daemon", "." ]
585da418ec37dd138f1a4277718b6f507e9536a2
https://github.com/tkf/rash/blob/585da418ec37dd138f1a4277718b6f507e9536a2/rash/daemon.py#L20-L107
56,031
tkf/rash
rash/show.py
show_run
def show_run(command_history_id): """ Show detailed command history by its ID. """ from pprint import pprint from .config import ConfigStore from .database import DataBase db = DataBase(ConfigStore().db_path) with db.connection(): for ch_id in command_history_id: crec...
python
def show_run(command_history_id): """ Show detailed command history by its ID. """ from pprint import pprint from .config import ConfigStore from .database import DataBase db = DataBase(ConfigStore().db_path) with db.connection(): for ch_id in command_history_id: crec...
[ "def", "show_run", "(", "command_history_id", ")", ":", "from", "pprint", "import", "pprint", "from", ".", "config", "import", "ConfigStore", "from", ".", "database", "import", "DataBase", "db", "=", "DataBase", "(", "ConfigStore", "(", ")", ".", "db_path", ...
Show detailed command history by its ID.
[ "Show", "detailed", "command", "history", "by", "its", "ID", "." ]
585da418ec37dd138f1a4277718b6f507e9536a2
https://github.com/tkf/rash/blob/585da418ec37dd138f1a4277718b6f507e9536a2/rash/show.py#L17-L29
56,032
pebble/libpebble2
libpebble2/services/blobdb.py
BlobDBClient.insert
def insert(self, database, key, value, callback=None): """ Insert an item into the given database. :param database: The database into which to insert the value. :type database: .BlobDatabaseID :param key: The key to insert. :type key: uuid.UUID :param value: The ...
python
def insert(self, database, key, value, callback=None): """ Insert an item into the given database. :param database: The database into which to insert the value. :type database: .BlobDatabaseID :param key: The key to insert. :type key: uuid.UUID :param value: The ...
[ "def", "insert", "(", "self", ",", "database", ",", "key", ",", "value", ",", "callback", "=", "None", ")", ":", "token", "=", "self", ".", "_get_token", "(", ")", "self", ".", "_enqueue", "(", "self", ".", "_PendingItem", "(", "token", ",", "BlobCom...
Insert an item into the given database. :param database: The database into which to insert the value. :type database: .BlobDatabaseID :param key: The key to insert. :type key: uuid.UUID :param value: The value to insert. :type value: bytes :param callback: A call...
[ "Insert", "an", "item", "into", "the", "given", "database", "." ]
23e2eb92cfc084e6f9e8c718711ac994ef606d18
https://github.com/pebble/libpebble2/blob/23e2eb92cfc084e6f9e8c718711ac994ef606d18/libpebble2/services/blobdb.py#L59-L74
56,033
pebble/libpebble2
libpebble2/services/blobdb.py
BlobDBClient.delete
def delete(self, database, key, callback=None): """ Delete an item from the given database. :param database: The database from which to delete the value. :type database: .BlobDatabaseID :param key: The key to delete. :type key: uuid.UUID :param callback: A callba...
python
def delete(self, database, key, callback=None): """ Delete an item from the given database. :param database: The database from which to delete the value. :type database: .BlobDatabaseID :param key: The key to delete. :type key: uuid.UUID :param callback: A callba...
[ "def", "delete", "(", "self", ",", "database", ",", "key", ",", "callback", "=", "None", ")", ":", "token", "=", "self", ".", "_get_token", "(", ")", "self", ".", "_enqueue", "(", "self", ".", "_PendingItem", "(", "token", ",", "BlobCommand", "(", "t...
Delete an item from the given database. :param database: The database from which to delete the value. :type database: .BlobDatabaseID :param key: The key to delete. :type key: uuid.UUID :param callback: A callback to be called on success or failure.
[ "Delete", "an", "item", "from", "the", "given", "database", "." ]
23e2eb92cfc084e6f9e8c718711ac994ef606d18
https://github.com/pebble/libpebble2/blob/23e2eb92cfc084e6f9e8c718711ac994ef606d18/libpebble2/services/blobdb.py#L76-L89
56,034
ianclegg/winrmlib
winrmlib/api/service.py
Service.invoke
def invoke(self, headers, body): """ Invokes the soap service """ xml = Service._create_request(headers, body) try: response = self.session.post(self.endpoint, verify=False, data=xml) logging.debug(response.content) except Exception as e: ...
python
def invoke(self, headers, body): """ Invokes the soap service """ xml = Service._create_request(headers, body) try: response = self.session.post(self.endpoint, verify=False, data=xml) logging.debug(response.content) except Exception as e: ...
[ "def", "invoke", "(", "self", ",", "headers", ",", "body", ")", ":", "xml", "=", "Service", ".", "_create_request", "(", "headers", ",", "body", ")", "try", ":", "response", "=", "self", ".", "session", ".", "post", "(", "self", ".", "endpoint", ",",...
Invokes the soap service
[ "Invokes", "the", "soap", "service" ]
489b3ce5d0e6a9a7301ba5d345ba82fa824c1431
https://github.com/ianclegg/winrmlib/blob/489b3ce5d0e6a9a7301ba5d345ba82fa824c1431/winrmlib/api/service.py#L55-L74
56,035
ianclegg/winrmlib
winrmlib/api/service.py
Service._determine_auth_mechanism
def _determine_auth_mechanism(username, password, delegation): """ if the username contains at '@' sign we will use kerberos if the username contains a '/ we will use ntlm either NTLM or Kerberos. In fact its basically always Negotiate. """ if re.match('(.*)@(.+)', userna...
python
def _determine_auth_mechanism(username, password, delegation): """ if the username contains at '@' sign we will use kerberos if the username contains a '/ we will use ntlm either NTLM or Kerberos. In fact its basically always Negotiate. """ if re.match('(.*)@(.+)', userna...
[ "def", "_determine_auth_mechanism", "(", "username", ",", "password", ",", "delegation", ")", ":", "if", "re", ".", "match", "(", "'(.*)@(.+)'", ",", "username", ")", "is", "not", "None", ":", "if", "delegation", "is", "True", ":", "raise", "Exception", "(...
if the username contains at '@' sign we will use kerberos if the username contains a '/ we will use ntlm either NTLM or Kerberos. In fact its basically always Negotiate.
[ "if", "the", "username", "contains", "at" ]
489b3ce5d0e6a9a7301ba5d345ba82fa824c1431
https://github.com/ianclegg/winrmlib/blob/489b3ce5d0e6a9a7301ba5d345ba82fa824c1431/winrmlib/api/service.py#L77-L104
56,036
ianclegg/winrmlib
winrmlib/api/service.py
Service._create_request
def _create_request(headers, body): """ Create the SOAP 1.2 Envelope An ordered dictionary is required to ensure the same order is reflected in the XML, otherwise the SOAP Body element would appear before the Header element. """ envelope = OrderedDict() for (names...
python
def _create_request(headers, body): """ Create the SOAP 1.2 Envelope An ordered dictionary is required to ensure the same order is reflected in the XML, otherwise the SOAP Body element would appear before the Header element. """ envelope = OrderedDict() for (names...
[ "def", "_create_request", "(", "headers", ",", "body", ")", ":", "envelope", "=", "OrderedDict", "(", ")", "for", "(", "namespace", ",", "alias", ")", "in", "Service", ".", "Namespaces", ".", "items", "(", ")", ":", "envelope", "[", "'@xmlns:'", "+", "...
Create the SOAP 1.2 Envelope An ordered dictionary is required to ensure the same order is reflected in the XML, otherwise the SOAP Body element would appear before the Header element.
[ "Create", "the", "SOAP", "1", ".", "2", "Envelope", "An", "ordered", "dictionary", "is", "required", "to", "ensure", "the", "same", "order", "is", "reflected", "in", "the", "XML", "otherwise", "the", "SOAP", "Body", "element", "would", "appear", "before", ...
489b3ce5d0e6a9a7301ba5d345ba82fa824c1431
https://github.com/ianclegg/winrmlib/blob/489b3ce5d0e6a9a7301ba5d345ba82fa824c1431/winrmlib/api/service.py#L107-L118
56,037
ianclegg/winrmlib
winrmlib/api/service.py
Service._parse_response
def _parse_response(xml): """ Attempt to parse the SOAP response and return a python object Raise a WSManException if a Fault is found """ try: soap_response = xmltodict.parse(xml, process_namespaces=True, namespaces=Service.Namespaces) except Exception: ...
python
def _parse_response(xml): """ Attempt to parse the SOAP response and return a python object Raise a WSManException if a Fault is found """ try: soap_response = xmltodict.parse(xml, process_namespaces=True, namespaces=Service.Namespaces) except Exception: ...
[ "def", "_parse_response", "(", "xml", ")", ":", "try", ":", "soap_response", "=", "xmltodict", ".", "parse", "(", "xml", ",", "process_namespaces", "=", "True", ",", "namespaces", "=", "Service", ".", "Namespaces", ")", "except", "Exception", ":", "logging",...
Attempt to parse the SOAP response and return a python object Raise a WSManException if a Fault is found
[ "Attempt", "to", "parse", "the", "SOAP", "response", "and", "return", "a", "python", "object", "Raise", "a", "WSManException", "if", "a", "Fault", "is", "found" ]
489b3ce5d0e6a9a7301ba5d345ba82fa824c1431
https://github.com/ianclegg/winrmlib/blob/489b3ce5d0e6a9a7301ba5d345ba82fa824c1431/winrmlib/api/service.py#L121-L136
56,038
nimeshkverma/mongo_joins
mongojoin/mongocollection.py
MongoCollection.get_mongo_cursor
def get_mongo_cursor(self, bulk=False): """ Returns Mongo cursor using the class variables :param bulk: bulk writer option :type bulk: boolean :return: mongo collection for which cursor will be created :rtype: mongo colection object """ ...
python
def get_mongo_cursor(self, bulk=False): """ Returns Mongo cursor using the class variables :param bulk: bulk writer option :type bulk: boolean :return: mongo collection for which cursor will be created :rtype: mongo colection object """ ...
[ "def", "get_mongo_cursor", "(", "self", ",", "bulk", "=", "False", ")", ":", "try", ":", "if", "self", ".", "host", ":", "if", "self", ".", "port", ":", "client", "=", "MongoClient", "(", "self", ".", "host", ",", "self", ".", "port", ")", "else", ...
Returns Mongo cursor using the class variables :param bulk: bulk writer option :type bulk: boolean :return: mongo collection for which cursor will be created :rtype: mongo colection object
[ "Returns", "Mongo", "cursor", "using", "the", "class", "variables" ]
64c416c3402d5906f707b73867fbc55e28d5ec37
https://github.com/nimeshkverma/mongo_joins/blob/64c416c3402d5906f707b73867fbc55e28d5ec37/mongojoin/mongocollection.py#L58-L95
56,039
nimeshkverma/mongo_joins
mongojoin/mongocollection.py
MongoCollection.bulk_cursor_execute
def bulk_cursor_execute(self, bulk_cursor): """ Executes the bulk_cursor :param bulk_cursor: Cursor to perform bulk operations :type bulk_cursor: pymongo bulk cursor object :returns: pymongo bulk cursor object (for bulk operations) """ try: ...
python
def bulk_cursor_execute(self, bulk_cursor): """ Executes the bulk_cursor :param bulk_cursor: Cursor to perform bulk operations :type bulk_cursor: pymongo bulk cursor object :returns: pymongo bulk cursor object (for bulk operations) """ try: ...
[ "def", "bulk_cursor_execute", "(", "self", ",", "bulk_cursor", ")", ":", "try", ":", "result", "=", "bulk_cursor", ".", "execute", "(", ")", "except", "BulkWriteError", "as", "bwe", ":", "msg", "=", "\"bulk_cursor_execute: Exception in executing Bulk cursor to mongo w...
Executes the bulk_cursor :param bulk_cursor: Cursor to perform bulk operations :type bulk_cursor: pymongo bulk cursor object :returns: pymongo bulk cursor object (for bulk operations)
[ "Executes", "the", "bulk_cursor" ]
64c416c3402d5906f707b73867fbc55e28d5ec37
https://github.com/nimeshkverma/mongo_joins/blob/64c416c3402d5906f707b73867fbc55e28d5ec37/mongojoin/mongocollection.py#L97-L115
56,040
tkf/rash
rash/utils/termdetection.py
detect_terminal
def detect_terminal(_environ=os.environ): """ Detect "terminal" you are using. First, this function checks if you are in tmux, byobu, or screen. If not it uses $COLORTERM [#]_ if defined and fallbacks to $TERM. .. [#] So, if you are in Gnome Terminal you have "gnome-terminal" instead of "xt...
python
def detect_terminal(_environ=os.environ): """ Detect "terminal" you are using. First, this function checks if you are in tmux, byobu, or screen. If not it uses $COLORTERM [#]_ if defined and fallbacks to $TERM. .. [#] So, if you are in Gnome Terminal you have "gnome-terminal" instead of "xt...
[ "def", "detect_terminal", "(", "_environ", "=", "os", ".", "environ", ")", ":", "if", "_environ", ".", "get", "(", "'TMUX'", ")", ":", "return", "'tmux'", "elif", "subdict_by_key_prefix", "(", "_environ", ",", "'BYOBU'", ")", ":", "return", "'byobu'", "eli...
Detect "terminal" you are using. First, this function checks if you are in tmux, byobu, or screen. If not it uses $COLORTERM [#]_ if defined and fallbacks to $TERM. .. [#] So, if you are in Gnome Terminal you have "gnome-terminal" instead of "xterm-color"".
[ "Detect", "terminal", "you", "are", "using", "." ]
585da418ec37dd138f1a4277718b6f507e9536a2
https://github.com/tkf/rash/blob/585da418ec37dd138f1a4277718b6f507e9536a2/rash/utils/termdetection.py#L28-L48
56,041
Pytwitcher/pytwitcherapi
src/pytwitcherapi/chat/connection.py
ServerConnection3.get_waittime
def get_waittime(self): """Return the appropriate time to wait, if we sent too many messages :returns: the time to wait in seconds :rtype: :class:`float` :raises: None """ now = time.time() self.sentmessages.appendleft(now) if len(self.sentmessages) == se...
python
def get_waittime(self): """Return the appropriate time to wait, if we sent too many messages :returns: the time to wait in seconds :rtype: :class:`float` :raises: None """ now = time.time() self.sentmessages.appendleft(now) if len(self.sentmessages) == se...
[ "def", "get_waittime", "(", "self", ")", ":", "now", "=", "time", ".", "time", "(", ")", "self", ".", "sentmessages", ".", "appendleft", "(", "now", ")", "if", "len", "(", "self", ".", "sentmessages", ")", "==", "self", ".", "sentmessages", ".", "max...
Return the appropriate time to wait, if we sent too many messages :returns: the time to wait in seconds :rtype: :class:`float` :raises: None
[ "Return", "the", "appropriate", "time", "to", "wait", "if", "we", "sent", "too", "many", "messages" ]
d53ac5ad5ca113ecb7da542e8cdcbbf8c762b336
https://github.com/Pytwitcher/pytwitcherapi/blob/d53ac5ad5ca113ecb7da542e8cdcbbf8c762b336/src/pytwitcherapi/chat/connection.py#L92-L108
56,042
Pytwitcher/pytwitcherapi
src/pytwitcherapi/chat/connection.py
ServerConnection3._process_line
def _process_line(self, line): """Process the given line and handle the events :param line: the raw message :type line: :class:`str` :returns: None :rtype: None :raises: None """ m = self._rfc_1459_command_regexp.match(line) prefix = m.group('pref...
python
def _process_line(self, line): """Process the given line and handle the events :param line: the raw message :type line: :class:`str` :returns: None :rtype: None :raises: None """ m = self._rfc_1459_command_regexp.match(line) prefix = m.group('pref...
[ "def", "_process_line", "(", "self", ",", "line", ")", ":", "m", "=", "self", ".", "_rfc_1459_command_regexp", ".", "match", "(", "line", ")", "prefix", "=", "m", ".", "group", "(", "'prefix'", ")", "tags", "=", "self", ".", "_process_tags", "(", "m", ...
Process the given line and handle the events :param line: the raw message :type line: :class:`str` :returns: None :rtype: None :raises: None
[ "Process", "the", "given", "line", "and", "handle", "the", "events" ]
d53ac5ad5ca113ecb7da542e8cdcbbf8c762b336
https://github.com/Pytwitcher/pytwitcherapi/blob/d53ac5ad5ca113ecb7da542e8cdcbbf8c762b336/src/pytwitcherapi/chat/connection.py#L131-L162
56,043
Pytwitcher/pytwitcherapi
src/pytwitcherapi/chat/connection.py
ServerConnection3._resolve_command
def _resolve_command(self, command, target): """Get the correct event for the command Only for 'privmsg' and 'notice' commands. :param command: The command string :type command: :class:`str` :param target: either a user or a channel :type target: :class:`str` :r...
python
def _resolve_command(self, command, target): """Get the correct event for the command Only for 'privmsg' and 'notice' commands. :param command: The command string :type command: :class:`str` :param target: either a user or a channel :type target: :class:`str` :r...
[ "def", "_resolve_command", "(", "self", ",", "command", ",", "target", ")", ":", "if", "command", "==", "\"privmsg\"", ":", "if", "irc", ".", "client", ".", "is_channel", "(", "target", ")", ":", "command", "=", "\"pubmsg\"", "else", ":", "if", "irc", ...
Get the correct event for the command Only for 'privmsg' and 'notice' commands. :param command: The command string :type command: :class:`str` :param target: either a user or a channel :type target: :class:`str` :returns: the correct event type :rtype: :class:`s...
[ "Get", "the", "correct", "event", "for", "the", "command" ]
d53ac5ad5ca113ecb7da542e8cdcbbf8c762b336
https://github.com/Pytwitcher/pytwitcherapi/blob/d53ac5ad5ca113ecb7da542e8cdcbbf8c762b336/src/pytwitcherapi/chat/connection.py#L164-L185
56,044
Pytwitcher/pytwitcherapi
src/pytwitcherapi/chat/connection.py
ServerConnection3._handle_message
def _handle_message(self, tags, source, command, target, msg): """Construct the correct events and handle them :param tags: the tags of the message :type tags: :class:`list` of :class:`message.Tag` :param source: the sender of the message :type source: :class:`str` :para...
python
def _handle_message(self, tags, source, command, target, msg): """Construct the correct events and handle them :param tags: the tags of the message :type tags: :class:`list` of :class:`message.Tag` :param source: the sender of the message :type source: :class:`str` :para...
[ "def", "_handle_message", "(", "self", ",", "tags", ",", "source", ",", "command", ",", "target", ",", "msg", ")", ":", "if", "isinstance", "(", "msg", ",", "tuple", ")", ":", "if", "command", "in", "[", "\"privmsg\"", ",", "\"pubmsg\"", "]", ":", "c...
Construct the correct events and handle them :param tags: the tags of the message :type tags: :class:`list` of :class:`message.Tag` :param source: the sender of the message :type source: :class:`str` :param command: the event type :type command: :class:`str` :par...
[ "Construct", "the", "correct", "events", "and", "handle", "them" ]
d53ac5ad5ca113ecb7da542e8cdcbbf8c762b336
https://github.com/Pytwitcher/pytwitcherapi/blob/d53ac5ad5ca113ecb7da542e8cdcbbf8c762b336/src/pytwitcherapi/chat/connection.py#L187-L222
56,045
Pytwitcher/pytwitcherapi
src/pytwitcherapi/chat/connection.py
ServerConnection3._process_tags
def _process_tags(self, tags): """Process the tags of the message :param tags: the tags string of a message :type tags: :class:`str` | None :returns: list of tags :rtype: :class:`list` of :class:`message.Tag` :raises: None """ if not tags: ret...
python
def _process_tags(self, tags): """Process the tags of the message :param tags: the tags string of a message :type tags: :class:`str` | None :returns: list of tags :rtype: :class:`list` of :class:`message.Tag` :raises: None """ if not tags: ret...
[ "def", "_process_tags", "(", "self", ",", "tags", ")", ":", "if", "not", "tags", ":", "return", "[", "]", "return", "[", "message", ".", "Tag", ".", "from_str", "(", "x", ")", "for", "x", "in", "tags", ".", "split", "(", "';'", ")", "]" ]
Process the tags of the message :param tags: the tags string of a message :type tags: :class:`str` | None :returns: list of tags :rtype: :class:`list` of :class:`message.Tag` :raises: None
[ "Process", "the", "tags", "of", "the", "message" ]
d53ac5ad5ca113ecb7da542e8cdcbbf8c762b336
https://github.com/Pytwitcher/pytwitcherapi/blob/d53ac5ad5ca113ecb7da542e8cdcbbf8c762b336/src/pytwitcherapi/chat/connection.py#L224-L235
56,046
Pytwitcher/pytwitcherapi
src/pytwitcherapi/chat/connection.py
ServerConnection3._process_arguments
def _process_arguments(self, arguments): """Process the arguments :param arguments: arguments string of a message :type arguments: :class:`str` | None :returns: A list of arguments :rtype: :class:`list` of :class:`str` | None :raises: None """ if not argu...
python
def _process_arguments(self, arguments): """Process the arguments :param arguments: arguments string of a message :type arguments: :class:`str` | None :returns: A list of arguments :rtype: :class:`list` of :class:`str` | None :raises: None """ if not argu...
[ "def", "_process_arguments", "(", "self", ",", "arguments", ")", ":", "if", "not", "arguments", ":", "return", "None", "a", "=", "arguments", ".", "split", "(", "\" :\"", ",", "1", ")", "arglist", "=", "a", "[", "0", "]", ".", "split", "(", ")", "i...
Process the arguments :param arguments: arguments string of a message :type arguments: :class:`str` | None :returns: A list of arguments :rtype: :class:`list` of :class:`str` | None :raises: None
[ "Process", "the", "arguments" ]
d53ac5ad5ca113ecb7da542e8cdcbbf8c762b336
https://github.com/Pytwitcher/pytwitcherapi/blob/d53ac5ad5ca113ecb7da542e8cdcbbf8c762b336/src/pytwitcherapi/chat/connection.py#L264-L279
56,047
nimeshkverma/mongo_joins
mongojoin/processdata.py
CollectionsProcessedData.fetch_and_process_data
def fetch_and_process_data(self, collection, pipeline): """ Fetches and Processess data from the input collection by aggregating using the pipeline :param collection: The collection object for which mongo connection has to be made :type collection: MongoCollection ...
python
def fetch_and_process_data(self, collection, pipeline): """ Fetches and Processess data from the input collection by aggregating using the pipeline :param collection: The collection object for which mongo connection has to be made :type collection: MongoCollection ...
[ "def", "fetch_and_process_data", "(", "self", ",", "collection", ",", "pipeline", ")", ":", "collection_cursor", "=", "collection", ".", "get_mongo_cursor", "(", ")", "grouped_docs", "=", "list", "(", "collection_cursor", ".", "aggregate", "(", "pipeline", ")", ...
Fetches and Processess data from the input collection by aggregating using the pipeline :param collection: The collection object for which mongo connection has to be made :type collection: MongoCollection :param pipeline: The pipeline using which aggregation will be performed ...
[ "Fetches", "and", "Processess", "data", "from", "the", "input", "collection", "by", "aggregating", "using", "the", "pipeline" ]
64c416c3402d5906f707b73867fbc55e28d5ec37
https://github.com/nimeshkverma/mongo_joins/blob/64c416c3402d5906f707b73867fbc55e28d5ec37/mongojoin/processdata.py#L73-L97
56,048
nimeshkverma/mongo_joins
mongojoin/processdata.py
CollectionsProcessedData.get_collections_data
def get_collections_data(self): """ Driver function to fetch the data from the two collections """ collections = { 'left': self.left_collection, 'right': self.right_collection } for collection_type, collection in collections.iteritems(): ...
python
def get_collections_data(self): """ Driver function to fetch the data from the two collections """ collections = { 'left': self.left_collection, 'right': self.right_collection } for collection_type, collection in collections.iteritems(): ...
[ "def", "get_collections_data", "(", "self", ")", ":", "collections", "=", "{", "'left'", ":", "self", ".", "left_collection", ",", "'right'", ":", "self", ".", "right_collection", "}", "for", "collection_type", ",", "collection", "in", "collections", ".", "ite...
Driver function to fetch the data from the two collections
[ "Driver", "function", "to", "fetch", "the", "data", "from", "the", "two", "collections" ]
64c416c3402d5906f707b73867fbc55e28d5ec37
https://github.com/nimeshkverma/mongo_joins/blob/64c416c3402d5906f707b73867fbc55e28d5ec37/mongojoin/processdata.py#L99-L111
56,049
tkf/rash
rash/utils/timeutils.py
parse_duration
def parse_duration(string): """ Parse human readable duration. >>> parse_duration('1m') 60 >>> parse_duration('7 days') == 7 * 24 * 60 * 60 True """ if string.isdigit(): return int(string) try: return float(string) except ValueError: pass string = st...
python
def parse_duration(string): """ Parse human readable duration. >>> parse_duration('1m') 60 >>> parse_duration('7 days') == 7 * 24 * 60 * 60 True """ if string.isdigit(): return int(string) try: return float(string) except ValueError: pass string = st...
[ "def", "parse_duration", "(", "string", ")", ":", "if", "string", ".", "isdigit", "(", ")", ":", "return", "int", "(", "string", ")", "try", ":", "return", "float", "(", "string", ")", "except", "ValueError", ":", "pass", "string", "=", "string", ".", ...
Parse human readable duration. >>> parse_duration('1m') 60 >>> parse_duration('7 days') == 7 * 24 * 60 * 60 True
[ "Parse", "human", "readable", "duration", "." ]
585da418ec37dd138f1a4277718b6f507e9536a2
https://github.com/tkf/rash/blob/585da418ec37dd138f1a4277718b6f507e9536a2/rash/utils/timeutils.py#L36-L58
56,050
agusmakmun/djipsum
djipsum/faker.py
FakerModel.fake_chars_or_choice
def fake_chars_or_choice(self, field_name): """ Return fake chars or choice it if the `field_name` has choices. Then, returning random value from it. This specially for `CharField`. Usage: faker.fake_chars_or_choice('field_name') Example for field: ...
python
def fake_chars_or_choice(self, field_name): """ Return fake chars or choice it if the `field_name` has choices. Then, returning random value from it. This specially for `CharField`. Usage: faker.fake_chars_or_choice('field_name') Example for field: ...
[ "def", "fake_chars_or_choice", "(", "self", ",", "field_name", ")", ":", "return", "self", ".", "djipsum_fields", "(", ")", ".", "randomCharField", "(", "self", ".", "model_class", "(", ")", ",", "field_name", "=", "field_name", ")" ]
Return fake chars or choice it if the `field_name` has choices. Then, returning random value from it. This specially for `CharField`. Usage: faker.fake_chars_or_choice('field_name') Example for field: TYPE_CHOICES = ( ('project', 'I wanna to talk a...
[ "Return", "fake", "chars", "or", "choice", "it", "if", "the", "field_name", "has", "choices", ".", "Then", "returning", "random", "value", "from", "it", ".", "This", "specially", "for", "CharField", "." ]
e7950556422b4039092db2083db7a83728230977
https://github.com/agusmakmun/djipsum/blob/e7950556422b4039092db2083db7a83728230977/djipsum/faker.py#L90-L110
56,051
agusmakmun/djipsum
djipsum/faker.py
FakerModel.fake_m2m
def fake_m2m(self, obj, field_name): """ Return the random objects from m2m relationship. The ManyToManyField need specific object, so i handle it after created the object. """ instance_m2m = getattr(obj, field_name) objects_m2m = instance_m2m.model.objects.all() ...
python
def fake_m2m(self, obj, field_name): """ Return the random objects from m2m relationship. The ManyToManyField need specific object, so i handle it after created the object. """ instance_m2m = getattr(obj, field_name) objects_m2m = instance_m2m.model.objects.all() ...
[ "def", "fake_m2m", "(", "self", ",", "obj", ",", "field_name", ")", ":", "instance_m2m", "=", "getattr", "(", "obj", ",", "field_name", ")", "objects_m2m", "=", "instance_m2m", ".", "model", ".", "objects", ".", "all", "(", ")", "if", "objects_m2m", ".",...
Return the random objects from m2m relationship. The ManyToManyField need specific object, so i handle it after created the object.
[ "Return", "the", "random", "objects", "from", "m2m", "relationship", ".", "The", "ManyToManyField", "need", "specific", "object", "so", "i", "handle", "it", "after", "created", "the", "object", "." ]
e7950556422b4039092db2083db7a83728230977
https://github.com/agusmakmun/djipsum/blob/e7950556422b4039092db2083db7a83728230977/djipsum/faker.py#L302-L324
56,052
agusmakmun/djipsum
djipsum/faker.py
FakerModel.create
def create(self, fields): """ Create the object only once. So, you need loop to usage. :param `fields` is dictionary fields. """ try: # Cleaning the fields, and check if has `ForeignKey` type. cleaned_fields = {} for key, value in fiel...
python
def create(self, fields): """ Create the object only once. So, you need loop to usage. :param `fields` is dictionary fields. """ try: # Cleaning the fields, and check if has `ForeignKey` type. cleaned_fields = {} for key, value in fiel...
[ "def", "create", "(", "self", ",", "fields", ")", ":", "try", ":", "# Cleaning the fields, and check if has `ForeignKey` type.", "cleaned_fields", "=", "{", "}", "for", "key", ",", "value", "in", "fields", ".", "items", "(", ")", ":", "if", "type", "(", "val...
Create the object only once. So, you need loop to usage. :param `fields` is dictionary fields.
[ "Create", "the", "object", "only", "once", ".", "So", "you", "need", "loop", "to", "usage", "." ]
e7950556422b4039092db2083db7a83728230977
https://github.com/agusmakmun/djipsum/blob/e7950556422b4039092db2083db7a83728230977/djipsum/faker.py#L326-L366
56,053
alpha-xone/xone
xone/calendar.py
trading_dates
def trading_dates(start, end, calendar='US'): """ Trading dates for given exchange Args: start: start date end: end date calendar: exchange as string Returns: pd.DatetimeIndex: datetime index Examples: >>> bus_dates = ['2018-12-24', '2018-12-26', '2018-12-2...
python
def trading_dates(start, end, calendar='US'): """ Trading dates for given exchange Args: start: start date end: end date calendar: exchange as string Returns: pd.DatetimeIndex: datetime index Examples: >>> bus_dates = ['2018-12-24', '2018-12-26', '2018-12-2...
[ "def", "trading_dates", "(", "start", ",", "end", ",", "calendar", "=", "'US'", ")", ":", "kw", "=", "dict", "(", "start", "=", "pd", ".", "Timestamp", "(", "start", ",", "tz", "=", "'UTC'", ")", ".", "date", "(", ")", ",", "end", "=", "pd", "....
Trading dates for given exchange Args: start: start date end: end date calendar: exchange as string Returns: pd.DatetimeIndex: datetime index Examples: >>> bus_dates = ['2018-12-24', '2018-12-26', '2018-12-27'] >>> trd_dates = trading_dates(start='2018-12-2...
[ "Trading", "dates", "for", "given", "exchange" ]
68534a30f7f1760b220ba58040be3927f7dfbcf4
https://github.com/alpha-xone/xone/blob/68534a30f7f1760b220ba58040be3927f7dfbcf4/xone/calendar.py#L22-L42
56,054
sangoma/pysensu
pysensu/api.py
SensuAPI.get_clients
def get_clients(self, limit=None, offset=None): """ Returns a list of clients. """ data = {} if limit: data['limit'] = limit if offset: data['offset'] = offset result = self._request('GET', '/clients', data=json.dumps(data)) return ...
python
def get_clients(self, limit=None, offset=None): """ Returns a list of clients. """ data = {} if limit: data['limit'] = limit if offset: data['offset'] = offset result = self._request('GET', '/clients', data=json.dumps(data)) return ...
[ "def", "get_clients", "(", "self", ",", "limit", "=", "None", ",", "offset", "=", "None", ")", ":", "data", "=", "{", "}", "if", "limit", ":", "data", "[", "'limit'", "]", "=", "limit", "if", "offset", ":", "data", "[", "'offset'", "]", "=", "off...
Returns a list of clients.
[ "Returns", "a", "list", "of", "clients", "." ]
dc6799edbf2635247aec61fcf45b04ddec1beb49
https://github.com/sangoma/pysensu/blob/dc6799edbf2635247aec61fcf45b04ddec1beb49/pysensu/api.py#L76-L86
56,055
sangoma/pysensu
pysensu/api.py
SensuAPI.get_client_data
def get_client_data(self, client): """ Returns a client. """ data = self._request('GET', '/clients/{}'.format(client)) return data.json()
python
def get_client_data(self, client): """ Returns a client. """ data = self._request('GET', '/clients/{}'.format(client)) return data.json()
[ "def", "get_client_data", "(", "self", ",", "client", ")", ":", "data", "=", "self", ".", "_request", "(", "'GET'", ",", "'/clients/{}'", ".", "format", "(", "client", ")", ")", "return", "data", ".", "json", "(", ")" ]
Returns a client.
[ "Returns", "a", "client", "." ]
dc6799edbf2635247aec61fcf45b04ddec1beb49
https://github.com/sangoma/pysensu/blob/dc6799edbf2635247aec61fcf45b04ddec1beb49/pysensu/api.py#L88-L93
56,056
sangoma/pysensu
pysensu/api.py
SensuAPI.get_client_history
def get_client_history(self, client): """ Returns the history for a client. """ data = self._request('GET', '/clients/{}/history'.format(client)) return data.json()
python
def get_client_history(self, client): """ Returns the history for a client. """ data = self._request('GET', '/clients/{}/history'.format(client)) return data.json()
[ "def", "get_client_history", "(", "self", ",", "client", ")", ":", "data", "=", "self", ".", "_request", "(", "'GET'", ",", "'/clients/{}/history'", ".", "format", "(", "client", ")", ")", "return", "data", ".", "json", "(", ")" ]
Returns the history for a client.
[ "Returns", "the", "history", "for", "a", "client", "." ]
dc6799edbf2635247aec61fcf45b04ddec1beb49
https://github.com/sangoma/pysensu/blob/dc6799edbf2635247aec61fcf45b04ddec1beb49/pysensu/api.py#L95-L100
56,057
sangoma/pysensu
pysensu/api.py
SensuAPI.get_all_client_events
def get_all_client_events(self, client): """ Returns the list of current events for a given client. """ data = self._request('GET', '/events/{}'.format(client)) return data.json()
python
def get_all_client_events(self, client): """ Returns the list of current events for a given client. """ data = self._request('GET', '/events/{}'.format(client)) return data.json()
[ "def", "get_all_client_events", "(", "self", ",", "client", ")", ":", "data", "=", "self", ".", "_request", "(", "'GET'", ",", "'/events/{}'", ".", "format", "(", "client", ")", ")", "return", "data", ".", "json", "(", ")" ]
Returns the list of current events for a given client.
[ "Returns", "the", "list", "of", "current", "events", "for", "a", "given", "client", "." ]
dc6799edbf2635247aec61fcf45b04ddec1beb49
https://github.com/sangoma/pysensu/blob/dc6799edbf2635247aec61fcf45b04ddec1beb49/pysensu/api.py#L119-L124
56,058
sangoma/pysensu
pysensu/api.py
SensuAPI.get_event
def get_event(self, client, check): """ Returns an event for a given client & check name. """ data = self._request('GET', '/events/{}/{}'.format(client, check)) return data.json()
python
def get_event(self, client, check): """ Returns an event for a given client & check name. """ data = self._request('GET', '/events/{}/{}'.format(client, check)) return data.json()
[ "def", "get_event", "(", "self", ",", "client", ",", "check", ")", ":", "data", "=", "self", ".", "_request", "(", "'GET'", ",", "'/events/{}/{}'", ".", "format", "(", "client", ",", "check", ")", ")", "return", "data", ".", "json", "(", ")" ]
Returns an event for a given client & check name.
[ "Returns", "an", "event", "for", "a", "given", "client", "&", "check", "name", "." ]
dc6799edbf2635247aec61fcf45b04ddec1beb49
https://github.com/sangoma/pysensu/blob/dc6799edbf2635247aec61fcf45b04ddec1beb49/pysensu/api.py#L126-L131
56,059
sangoma/pysensu
pysensu/api.py
SensuAPI.get_check
def get_check(self, check): """ Returns a check. """ data = self._request('GET', '/checks/{}'.format(check)) return data.json()
python
def get_check(self, check): """ Returns a check. """ data = self._request('GET', '/checks/{}'.format(check)) return data.json()
[ "def", "get_check", "(", "self", ",", "check", ")", ":", "data", "=", "self", ".", "_request", "(", "'GET'", ",", "'/checks/{}'", ".", "format", "(", "check", ")", ")", "return", "data", ".", "json", "(", ")" ]
Returns a check.
[ "Returns", "a", "check", "." ]
dc6799edbf2635247aec61fcf45b04ddec1beb49
https://github.com/sangoma/pysensu/blob/dc6799edbf2635247aec61fcf45b04ddec1beb49/pysensu/api.py#L158-L163
56,060
sangoma/pysensu
pysensu/api.py
SensuAPI.post_check_request
def post_check_request(self, check, subscribers): """ Issues a check execution request. """ data = { 'check': check, 'subscribers': [subscribers] } self._request('POST', '/request', data=json.dumps(data)) return True
python
def post_check_request(self, check, subscribers): """ Issues a check execution request. """ data = { 'check': check, 'subscribers': [subscribers] } self._request('POST', '/request', data=json.dumps(data)) return True
[ "def", "post_check_request", "(", "self", ",", "check", ",", "subscribers", ")", ":", "data", "=", "{", "'check'", ":", "check", ",", "'subscribers'", ":", "[", "subscribers", "]", "}", "self", ".", "_request", "(", "'POST'", ",", "'/request'", ",", "dat...
Issues a check execution request.
[ "Issues", "a", "check", "execution", "request", "." ]
dc6799edbf2635247aec61fcf45b04ddec1beb49
https://github.com/sangoma/pysensu/blob/dc6799edbf2635247aec61fcf45b04ddec1beb49/pysensu/api.py#L165-L174
56,061
sangoma/pysensu
pysensu/api.py
SensuAPI.post_silence_request
def post_silence_request(self, kwargs): """ Create a silence entry. """ self._request('POST', '/silenced', data=json.dumps(kwargs)) return True
python
def post_silence_request(self, kwargs): """ Create a silence entry. """ self._request('POST', '/silenced', data=json.dumps(kwargs)) return True
[ "def", "post_silence_request", "(", "self", ",", "kwargs", ")", ":", "self", ".", "_request", "(", "'POST'", ",", "'/silenced'", ",", "data", "=", "json", ".", "dumps", "(", "kwargs", ")", ")", "return", "True" ]
Create a silence entry.
[ "Create", "a", "silence", "entry", "." ]
dc6799edbf2635247aec61fcf45b04ddec1beb49
https://github.com/sangoma/pysensu/blob/dc6799edbf2635247aec61fcf45b04ddec1beb49/pysensu/api.py#L191-L196
56,062
sangoma/pysensu
pysensu/api.py
SensuAPI.clear_silence
def clear_silence(self, kwargs): """ Clear a silence entry. """ self._request('POST', '/silenced/clear', data=json.dumps(kwargs)) return True
python
def clear_silence(self, kwargs): """ Clear a silence entry. """ self._request('POST', '/silenced/clear', data=json.dumps(kwargs)) return True
[ "def", "clear_silence", "(", "self", ",", "kwargs", ")", ":", "self", ".", "_request", "(", "'POST'", ",", "'/silenced/clear'", ",", "data", "=", "json", ".", "dumps", "(", "kwargs", ")", ")", "return", "True" ]
Clear a silence entry.
[ "Clear", "a", "silence", "entry", "." ]
dc6799edbf2635247aec61fcf45b04ddec1beb49
https://github.com/sangoma/pysensu/blob/dc6799edbf2635247aec61fcf45b04ddec1beb49/pysensu/api.py#L198-L203
56,063
sangoma/pysensu
pysensu/api.py
SensuAPI.get_aggregate_check
def get_aggregate_check(self, check, age=None): """ Returns the list of aggregates for a given check """ data = {} if age: data['max_age'] = age result = self._request('GET', '/aggregates/{}'.format(check), data=json.dumps(data)...
python
def get_aggregate_check(self, check, age=None): """ Returns the list of aggregates for a given check """ data = {} if age: data['max_age'] = age result = self._request('GET', '/aggregates/{}'.format(check), data=json.dumps(data)...
[ "def", "get_aggregate_check", "(", "self", ",", "check", ",", "age", "=", "None", ")", ":", "data", "=", "{", "}", "if", "age", ":", "data", "[", "'max_age'", "]", "=", "age", "result", "=", "self", ".", "_request", "(", "'GET'", ",", "'/aggregates/{...
Returns the list of aggregates for a given check
[ "Returns", "the", "list", "of", "aggregates", "for", "a", "given", "check" ]
dc6799edbf2635247aec61fcf45b04ddec1beb49
https://github.com/sangoma/pysensu/blob/dc6799edbf2635247aec61fcf45b04ddec1beb49/pysensu/api.py#L215-L225
56,064
sangoma/pysensu
pysensu/api.py
SensuAPI.get_health
def get_health(self, consumers=2, messages=100): """ Returns health information on transport & Redis connections. """ data = {'consumers': consumers, 'messages': messages} try: self._request('GET', '/health', data=json.dumps(data)) return True exc...
python
def get_health(self, consumers=2, messages=100): """ Returns health information on transport & Redis connections. """ data = {'consumers': consumers, 'messages': messages} try: self._request('GET', '/health', data=json.dumps(data)) return True exc...
[ "def", "get_health", "(", "self", ",", "consumers", "=", "2", ",", "messages", "=", "100", ")", ":", "data", "=", "{", "'consumers'", ":", "consumers", ",", "'messages'", ":", "messages", "}", "try", ":", "self", ".", "_request", "(", "'GET'", ",", "...
Returns health information on transport & Redis connections.
[ "Returns", "health", "information", "on", "transport", "&", "Redis", "connections", "." ]
dc6799edbf2635247aec61fcf45b04ddec1beb49
https://github.com/sangoma/pysensu/blob/dc6799edbf2635247aec61fcf45b04ddec1beb49/pysensu/api.py#L244-L254
56,065
sangoma/pysensu
pysensu/api.py
SensuAPI.get_results
def get_results(self, client): """ Returns a result. """ data = self._request('GET', '/results/{}'.format(client)) return data.json()
python
def get_results(self, client): """ Returns a result. """ data = self._request('GET', '/results/{}'.format(client)) return data.json()
[ "def", "get_results", "(", "self", ",", "client", ")", ":", "data", "=", "self", ".", "_request", "(", "'GET'", ",", "'/results/{}'", ".", "format", "(", "client", ")", ")", "return", "data", ".", "json", "(", ")" ]
Returns a result.
[ "Returns", "a", "result", "." ]
dc6799edbf2635247aec61fcf45b04ddec1beb49
https://github.com/sangoma/pysensu/blob/dc6799edbf2635247aec61fcf45b04ddec1beb49/pysensu/api.py#L266-L271
56,066
sangoma/pysensu
pysensu/api.py
SensuAPI.get_result
def get_result(self, client, check): """ Returns an event for a given client & result name. """ data = self._request('GET', '/results/{}/{}'.format(client, check)) return data.json()
python
def get_result(self, client, check): """ Returns an event for a given client & result name. """ data = self._request('GET', '/results/{}/{}'.format(client, check)) return data.json()
[ "def", "get_result", "(", "self", ",", "client", ",", "check", ")", ":", "data", "=", "self", ".", "_request", "(", "'GET'", ",", "'/results/{}/{}'", ".", "format", "(", "client", ",", "check", ")", ")", "return", "data", ".", "json", "(", ")" ]
Returns an event for a given client & result name.
[ "Returns", "an", "event", "for", "a", "given", "client", "&", "result", "name", "." ]
dc6799edbf2635247aec61fcf45b04ddec1beb49
https://github.com/sangoma/pysensu/blob/dc6799edbf2635247aec61fcf45b04ddec1beb49/pysensu/api.py#L273-L278
56,067
sangoma/pysensu
pysensu/api.py
SensuAPI.delete_result
def delete_result(self, client, check): """ Deletes an check result data for a given check on a given client. """ self._request('DELETE', '/results/{}/{}'.format(client, check)) return True
python
def delete_result(self, client, check): """ Deletes an check result data for a given check on a given client. """ self._request('DELETE', '/results/{}/{}'.format(client, check)) return True
[ "def", "delete_result", "(", "self", ",", "client", ",", "check", ")", ":", "self", ".", "_request", "(", "'DELETE'", ",", "'/results/{}/{}'", ".", "format", "(", "client", ",", "check", ")", ")", "return", "True" ]
Deletes an check result data for a given check on a given client.
[ "Deletes", "an", "check", "result", "data", "for", "a", "given", "check", "on", "a", "given", "client", "." ]
dc6799edbf2635247aec61fcf45b04ddec1beb49
https://github.com/sangoma/pysensu/blob/dc6799edbf2635247aec61fcf45b04ddec1beb49/pysensu/api.py#L280-L285
56,068
sangoma/pysensu
pysensu/api.py
SensuAPI.post_result_data
def post_result_data(self, client, check, output, status): """ Posts check result data. """ data = { 'source': client, 'name': check, 'output': output, 'status': status, } self._request('POST', '/results', data=json.dumps(da...
python
def post_result_data(self, client, check, output, status): """ Posts check result data. """ data = { 'source': client, 'name': check, 'output': output, 'status': status, } self._request('POST', '/results', data=json.dumps(da...
[ "def", "post_result_data", "(", "self", ",", "client", ",", "check", ",", "output", ",", "status", ")", ":", "data", "=", "{", "'source'", ":", "client", ",", "'name'", ":", "check", ",", "'output'", ":", "output", ",", "'status'", ":", "status", ",", ...
Posts check result data.
[ "Posts", "check", "result", "data", "." ]
dc6799edbf2635247aec61fcf45b04ddec1beb49
https://github.com/sangoma/pysensu/blob/dc6799edbf2635247aec61fcf45b04ddec1beb49/pysensu/api.py#L287-L298
56,069
sangoma/pysensu
pysensu/api.py
SensuAPI.get_subscriptions_channel
def get_subscriptions_channel(self, search_channel): """ Return all the nodes that are subscribed to the specified channel """ data = self.get_clients() clients = [] for client in data: if 'subscriptions' in client: if isinstance(client['subscr...
python
def get_subscriptions_channel(self, search_channel): """ Return all the nodes that are subscribed to the specified channel """ data = self.get_clients() clients = [] for client in data: if 'subscriptions' in client: if isinstance(client['subscr...
[ "def", "get_subscriptions_channel", "(", "self", ",", "search_channel", ")", ":", "data", "=", "self", ".", "get_clients", "(", ")", "clients", "=", "[", "]", "for", "client", "in", "data", ":", "if", "'subscriptions'", "in", "client", ":", "if", "isinstan...
Return all the nodes that are subscribed to the specified channel
[ "Return", "all", "the", "nodes", "that", "are", "subscribed", "to", "the", "specified", "channel" ]
dc6799edbf2635247aec61fcf45b04ddec1beb49
https://github.com/sangoma/pysensu/blob/dc6799edbf2635247aec61fcf45b04ddec1beb49/pysensu/api.py#L351-L365
56,070
denfromufa/clrmagic
setup.py
clrmagic_build_ext.build_extension
def build_extension(self, ext): """ build clrmagic.dll using csc or mcs """ if sys.platform == "win32": _clr_compiler = "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\csc.exe" else: _clr_compiler = "mcs" cmd = [ _clr_compiler, ...
python
def build_extension(self, ext): """ build clrmagic.dll using csc or mcs """ if sys.platform == "win32": _clr_compiler = "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\csc.exe" else: _clr_compiler = "mcs" cmd = [ _clr_compiler, ...
[ "def", "build_extension", "(", "self", ",", "ext", ")", ":", "if", "sys", ".", "platform", "==", "\"win32\"", ":", "_clr_compiler", "=", "\"C:\\\\Windows\\\\Microsoft.NET\\\\Framework\\\\v4.0.30319\\\\csc.exe\"", "else", ":", "_clr_compiler", "=", "\"mcs\"", "cmd", "=...
build clrmagic.dll using csc or mcs
[ "build", "clrmagic", ".", "dll", "using", "csc", "or", "mcs" ]
065215988f112419ca99abe140f13b03e3a14829
https://github.com/denfromufa/clrmagic/blob/065215988f112419ca99abe140f13b03e3a14829/setup.py#L11-L24
56,071
pebble/libpebble2
libpebble2/events/mixin.py
EventSourceMixin.wait_for_event
def wait_for_event(self, event, timeout=10): """ Block waiting for the given event. Returns the event params. :param event: The event to handle. :return: The event params. :param timeout: The maximum time to wait before raising :exc:`.TimeoutError`. """ return se...
python
def wait_for_event(self, event, timeout=10): """ Block waiting for the given event. Returns the event params. :param event: The event to handle. :return: The event params. :param timeout: The maximum time to wait before raising :exc:`.TimeoutError`. """ return se...
[ "def", "wait_for_event", "(", "self", ",", "event", ",", "timeout", "=", "10", ")", ":", "return", "self", ".", "__handler", ".", "wait_for_event", "(", "event", ",", "timeout", "=", "timeout", ")" ]
Block waiting for the given event. Returns the event params. :param event: The event to handle. :return: The event params. :param timeout: The maximum time to wait before raising :exc:`.TimeoutError`.
[ "Block", "waiting", "for", "the", "given", "event", ".", "Returns", "the", "event", "params", "." ]
23e2eb92cfc084e6f9e8c718711ac994ef606d18
https://github.com/pebble/libpebble2/blob/23e2eb92cfc084e6f9e8c718711ac994ef606d18/libpebble2/events/mixin.py#L32-L40
56,072
avalente/appmetrics
appmetrics/histogram.py
search_greater
def search_greater(values, target): """ Return the first index for which target is greater or equal to the first item of the tuple found in values """ first = 0 last = len(values) while first < last: middle = (first + last) // 2 if values[middle][0] < target: fir...
python
def search_greater(values, target): """ Return the first index for which target is greater or equal to the first item of the tuple found in values """ first = 0 last = len(values) while first < last: middle = (first + last) // 2 if values[middle][0] < target: fir...
[ "def", "search_greater", "(", "values", ",", "target", ")", ":", "first", "=", "0", "last", "=", "len", "(", "values", ")", "while", "first", "<", "last", ":", "middle", "=", "(", "first", "+", "last", ")", "//", "2", "if", "values", "[", "middle",...
Return the first index for which target is greater or equal to the first item of the tuple found in values
[ "Return", "the", "first", "index", "for", "which", "target", "is", "greater", "or", "equal", "to", "the", "first", "item", "of", "the", "tuple", "found", "in", "values" ]
366fc7e1ca897e49a2227cbfa43bfa02a47f1acc
https://github.com/avalente/appmetrics/blob/366fc7e1ca897e49a2227cbfa43bfa02a47f1acc/appmetrics/histogram.py#L33-L48
56,073
avalente/appmetrics
appmetrics/histogram.py
ReservoirBase.add
def add(self, value): """ Add a value to the reservoir The value will be casted to a floating-point, so a TypeError or a ValueError may be raised. """ if not isinstance(value, float): value = float(value) return self._do_add(value)
python
def add(self, value): """ Add a value to the reservoir The value will be casted to a floating-point, so a TypeError or a ValueError may be raised. """ if not isinstance(value, float): value = float(value) return self._do_add(value)
[ "def", "add", "(", "self", ",", "value", ")", ":", "if", "not", "isinstance", "(", "value", ",", "float", ")", ":", "value", "=", "float", "(", "value", ")", "return", "self", ".", "_do_add", "(", "value", ")" ]
Add a value to the reservoir The value will be casted to a floating-point, so a TypeError or a ValueError may be raised.
[ "Add", "a", "value", "to", "the", "reservoir", "The", "value", "will", "be", "casted", "to", "a", "floating", "-", "point", "so", "a", "TypeError", "or", "a", "ValueError", "may", "be", "raised", "." ]
366fc7e1ca897e49a2227cbfa43bfa02a47f1acc
https://github.com/avalente/appmetrics/blob/366fc7e1ca897e49a2227cbfa43bfa02a47f1acc/appmetrics/histogram.py#L59-L69
56,074
avalente/appmetrics
appmetrics/histogram.py
ReservoirBase.same_kind
def same_kind(self, other): """ Return True if "other" is an object of the same type and it was instantiated with the same parameters """ return type(self) is type(other) and self._same_parameters(other)
python
def same_kind(self, other): """ Return True if "other" is an object of the same type and it was instantiated with the same parameters """ return type(self) is type(other) and self._same_parameters(other)
[ "def", "same_kind", "(", "self", ",", "other", ")", ":", "return", "type", "(", "self", ")", "is", "type", "(", "other", ")", "and", "self", ".", "_same_parameters", "(", "other", ")" ]
Return True if "other" is an object of the same type and it was instantiated with the same parameters
[ "Return", "True", "if", "other", "is", "an", "object", "of", "the", "same", "type", "and", "it", "was", "instantiated", "with", "the", "same", "parameters" ]
366fc7e1ca897e49a2227cbfa43bfa02a47f1acc
https://github.com/avalente/appmetrics/blob/366fc7e1ca897e49a2227cbfa43bfa02a47f1acc/appmetrics/histogram.py#L87-L93
56,075
avalente/appmetrics
appmetrics/histogram.py
ExponentialDecayingReservoir._lookup
def _lookup(self, timestamp): """ Return the index of the value associated with "timestamp" if any, else None. Since the timestamps are floating-point values, they are considered equal if their absolute difference is smaller than self.EPSILON """ idx = search_gre...
python
def _lookup(self, timestamp): """ Return the index of the value associated with "timestamp" if any, else None. Since the timestamps are floating-point values, they are considered equal if their absolute difference is smaller than self.EPSILON """ idx = search_gre...
[ "def", "_lookup", "(", "self", ",", "timestamp", ")", ":", "idx", "=", "search_greater", "(", "self", ".", "_values", ",", "timestamp", ")", "if", "(", "idx", "<", "len", "(", "self", ".", "_values", ")", "and", "math", ".", "fabs", "(", "self", "....
Return the index of the value associated with "timestamp" if any, else None. Since the timestamps are floating-point values, they are considered equal if their absolute difference is smaller than self.EPSILON
[ "Return", "the", "index", "of", "the", "value", "associated", "with", "timestamp", "if", "any", "else", "None", ".", "Since", "the", "timestamps", "are", "floating", "-", "point", "values", "they", "are", "considered", "equal", "if", "their", "absolute", "di...
366fc7e1ca897e49a2227cbfa43bfa02a47f1acc
https://github.com/avalente/appmetrics/blob/366fc7e1ca897e49a2227cbfa43bfa02a47f1acc/appmetrics/histogram.py#L258-L270
56,076
avalente/appmetrics
appmetrics/histogram.py
ExponentialDecayingReservoir._put
def _put(self, timestamp, value): """Replace the value associated with "timestamp" or add the new value""" idx = self._lookup(timestamp) if idx is not None: self._values[idx] = (timestamp, value) else: self._values.append((timestamp, value))
python
def _put(self, timestamp, value): """Replace the value associated with "timestamp" or add the new value""" idx = self._lookup(timestamp) if idx is not None: self._values[idx] = (timestamp, value) else: self._values.append((timestamp, value))
[ "def", "_put", "(", "self", ",", "timestamp", ",", "value", ")", ":", "idx", "=", "self", ".", "_lookup", "(", "timestamp", ")", "if", "idx", "is", "not", "None", ":", "self", ".", "_values", "[", "idx", "]", "=", "(", "timestamp", ",", "value", ...
Replace the value associated with "timestamp" or add the new value
[ "Replace", "the", "value", "associated", "with", "timestamp", "or", "add", "the", "new", "value" ]
366fc7e1ca897e49a2227cbfa43bfa02a47f1acc
https://github.com/avalente/appmetrics/blob/366fc7e1ca897e49a2227cbfa43bfa02a47f1acc/appmetrics/histogram.py#L272-L279
56,077
pebble/libpebble2
libpebble2/services/appglances.py
AppGlances.reload_glance
def reload_glance(self, target_app, slices=None): """ Reloads an app's glance. Blocks as long as necessary. :param target_app: The UUID of the app for which to reload its glance. :type target_app: ~uuid.UUID :param slices: The slices with which to reload the app's glance. ...
python
def reload_glance(self, target_app, slices=None): """ Reloads an app's glance. Blocks as long as necessary. :param target_app: The UUID of the app for which to reload its glance. :type target_app: ~uuid.UUID :param slices: The slices with which to reload the app's glance. ...
[ "def", "reload_glance", "(", "self", ",", "target_app", ",", "slices", "=", "None", ")", ":", "glance", "=", "AppGlance", "(", "version", "=", "1", ",", "creation_time", "=", "time", ".", "time", "(", ")", ",", "slices", "=", "(", "slices", "or", "["...
Reloads an app's glance. Blocks as long as necessary. :param target_app: The UUID of the app for which to reload its glance. :type target_app: ~uuid.UUID :param slices: The slices with which to reload the app's glance. :type slices: list[.AppGlanceSlice]
[ "Reloads", "an", "app", "s", "glance", ".", "Blocks", "as", "long", "as", "necessary", "." ]
23e2eb92cfc084e6f9e8c718711ac994ef606d18
https://github.com/pebble/libpebble2/blob/23e2eb92cfc084e6f9e8c718711ac994ef606d18/libpebble2/services/appglances.py#L27-L41
56,078
Pytwitcher/pytwitcherapi
src/pytwitcherapi/oauth.py
LoginServer.set_token
def set_token(self, redirecturl): """Set the token on the session :param redirecturl: the original full redirect url :type redirecturl: :class:`str` :returns: None :rtype: None :raises: None """ log.debug('Setting the token on %s.' % self.session) ...
python
def set_token(self, redirecturl): """Set the token on the session :param redirecturl: the original full redirect url :type redirecturl: :class:`str` :returns: None :rtype: None :raises: None """ log.debug('Setting the token on %s.' % self.session) ...
[ "def", "set_token", "(", "self", ",", "redirecturl", ")", ":", "log", ".", "debug", "(", "'Setting the token on %s.'", "%", "self", ".", "session", ")", "self", ".", "session", ".", "token_from_fragment", "(", "redirecturl", ")" ]
Set the token on the session :param redirecturl: the original full redirect url :type redirecturl: :class:`str` :returns: None :rtype: None :raises: None
[ "Set", "the", "token", "on", "the", "session" ]
d53ac5ad5ca113ecb7da542e8cdcbbf8c762b336
https://github.com/Pytwitcher/pytwitcherapi/blob/d53ac5ad5ca113ecb7da542e8cdcbbf8c762b336/src/pytwitcherapi/oauth.py#L132-L142
56,079
BlendedSiteGenerator/Blended
blended/__main__.py
install_template
def install_template(username, repo): """Installs a Blended template from GitHub""" print("Installing template from " + username + "/" + repo) dpath = os.path.join(cwd, "templates") getunzipped(username, repo, dpath)
python
def install_template(username, repo): """Installs a Blended template from GitHub""" print("Installing template from " + username + "/" + repo) dpath = os.path.join(cwd, "templates") getunzipped(username, repo, dpath)
[ "def", "install_template", "(", "username", ",", "repo", ")", ":", "print", "(", "\"Installing template from \"", "+", "username", "+", "\"/\"", "+", "repo", ")", "dpath", "=", "os", ".", "path", ".", "join", "(", "cwd", ",", "\"templates\"", ")", "getunzi...
Installs a Blended template from GitHub
[ "Installs", "a", "Blended", "template", "from", "GitHub" ]
e5865a8633e461a22c86ef6ee98cdd7051c412ac
https://github.com/BlendedSiteGenerator/Blended/blob/e5865a8633e461a22c86ef6ee98cdd7051c412ac/blended/__main__.py#L65-L70
56,080
BlendedSiteGenerator/Blended
blended/__main__.py
import_wp
def import_wp(filepath): """Imports A WordPress export and converts it to a Blended site""" print("\nBlended: Static Website Generator -\n") checkConfig() print("Importing from WordPress...") wp = parseXML(filepath) wname = wp.rss.channel.title.cdata wdesc = wp.rss.channel.description.cd...
python
def import_wp(filepath): """Imports A WordPress export and converts it to a Blended site""" print("\nBlended: Static Website Generator -\n") checkConfig() print("Importing from WordPress...") wp = parseXML(filepath) wname = wp.rss.channel.title.cdata wdesc = wp.rss.channel.description.cd...
[ "def", "import_wp", "(", "filepath", ")", ":", "print", "(", "\"\\nBlended: Static Website Generator -\\n\"", ")", "checkConfig", "(", ")", "print", "(", "\"Importing from WordPress...\"", ")", "wp", "=", "parseXML", "(", "filepath", ")", "wname", "=", "wp", ".", ...
Imports A WordPress export and converts it to a Blended site
[ "Imports", "A", "WordPress", "export", "and", "converts", "it", "to", "a", "Blended", "site" ]
e5865a8633e461a22c86ef6ee98cdd7051c412ac
https://github.com/BlendedSiteGenerator/Blended/blob/e5865a8633e461a22c86ef6ee98cdd7051c412ac/blended/__main__.py#L75-L101
56,081
BlendedSiteGenerator/Blended
blended/__main__.py
import_blogger
def import_blogger(filepath): """Imports A Blogger export and converts it to a Blended site""" print("\nBlended: Static Website Generator -\n") checkConfig() print("Importing from Blogger...") blogger = parseXML(filepath) wname = blogger.feed.title.cdata aname = blogger.feed.author.name....
python
def import_blogger(filepath): """Imports A Blogger export and converts it to a Blended site""" print("\nBlended: Static Website Generator -\n") checkConfig() print("Importing from Blogger...") blogger = parseXML(filepath) wname = blogger.feed.title.cdata aname = blogger.feed.author.name....
[ "def", "import_blogger", "(", "filepath", ")", ":", "print", "(", "\"\\nBlended: Static Website Generator -\\n\"", ")", "checkConfig", "(", ")", "print", "(", "\"Importing from Blogger...\"", ")", "blogger", "=", "parseXML", "(", "filepath", ")", "wname", "=", "blog...
Imports A Blogger export and converts it to a Blended site
[ "Imports", "A", "Blogger", "export", "and", "converts", "it", "to", "a", "Blended", "site" ]
e5865a8633e461a22c86ef6ee98cdd7051c412ac
https://github.com/BlendedSiteGenerator/Blended/blob/e5865a8633e461a22c86ef6ee98cdd7051c412ac/blended/__main__.py#L106-L129
56,082
BlendedSiteGenerator/Blended
blended/__main__.py
install_plugin
def install_plugin(username, repo): """Installs a Blended plugin from GitHub""" print("Installing plugin from " + username + "/" + repo) pip.main(['install', '-U', "git+git://github.com/" + username + "/" + repo + ".git"])
python
def install_plugin(username, repo): """Installs a Blended plugin from GitHub""" print("Installing plugin from " + username + "/" + repo) pip.main(['install', '-U', "git+git://github.com/" + username + "/" + repo + ".git"])
[ "def", "install_plugin", "(", "username", ",", "repo", ")", ":", "print", "(", "\"Installing plugin from \"", "+", "username", "+", "\"/\"", "+", "repo", ")", "pip", ".", "main", "(", "[", "'install'", ",", "'-U'", ",", "\"git+git://github.com/\"", "+", "use...
Installs a Blended plugin from GitHub
[ "Installs", "a", "Blended", "plugin", "from", "GitHub" ]
e5865a8633e461a22c86ef6ee98cdd7051c412ac
https://github.com/BlendedSiteGenerator/Blended/blob/e5865a8633e461a22c86ef6ee98cdd7051c412ac/blended/__main__.py#L137-L142
56,083
BlendedSiteGenerator/Blended
blended/__main__.py
init
def init(): """Initiates a new website""" print("Blended: Static Website Generator -\n") checkConfig() if (sys.version_info > (3, 0)): wname = input("Website Name: ") wdesc = input("Website Description: ") wlan = input("Website Language: ") wlic = input("Website Licens...
python
def init(): """Initiates a new website""" print("Blended: Static Website Generator -\n") checkConfig() if (sys.version_info > (3, 0)): wname = input("Website Name: ") wdesc = input("Website Description: ") wlan = input("Website Language: ") wlic = input("Website Licens...
[ "def", "init", "(", ")", ":", "print", "(", "\"Blended: Static Website Generator -\\n\"", ")", "checkConfig", "(", ")", "if", "(", "sys", ".", "version_info", ">", "(", "3", ",", "0", ")", ")", ":", "wname", "=", "input", "(", "\"Website Name: \"", ")", ...
Initiates a new website
[ "Initiates", "a", "new", "website" ]
e5865a8633e461a22c86ef6ee98cdd7051c412ac
https://github.com/BlendedSiteGenerator/Blended/blob/e5865a8633e461a22c86ef6ee98cdd7051c412ac/blended/__main__.py#L146-L172
56,084
BlendedSiteGenerator/Blended
blended/__main__.py
placeFiles
def placeFiles(ftp, path): """Upload the built files to FTP""" for name in os.listdir(path): if name != "config.py" and name != "config.pyc" and name != "templates" and name != "content": localpath = os.path.join(path, name) if os.path.isfile(localpath): print("ST...
python
def placeFiles(ftp, path): """Upload the built files to FTP""" for name in os.listdir(path): if name != "config.py" and name != "config.pyc" and name != "templates" and name != "content": localpath = os.path.join(path, name) if os.path.isfile(localpath): print("ST...
[ "def", "placeFiles", "(", "ftp", ",", "path", ")", ":", "for", "name", "in", "os", ".", "listdir", "(", "path", ")", ":", "if", "name", "!=", "\"config.py\"", "and", "name", "!=", "\"config.pyc\"", "and", "name", "!=", "\"templates\"", "and", "name", "...
Upload the built files to FTP
[ "Upload", "the", "built", "files", "to", "FTP" ]
e5865a8633e461a22c86ef6ee98cdd7051c412ac
https://github.com/BlendedSiteGenerator/Blended/blob/e5865a8633e461a22c86ef6ee98cdd7051c412ac/blended/__main__.py#L175-L198
56,085
BlendedSiteGenerator/Blended
blended/__main__.py
send_ftp
def send_ftp(outdir): """Upload the built website to FTP""" print("Uploading the files in the " + outdir + "/ directory!\n") # Make sure there is actually a configuration file config_file_dir = os.path.join(cwd, "config.py") if not os.path.exists(config_file_dir): sys.exit( "The...
python
def send_ftp(outdir): """Upload the built website to FTP""" print("Uploading the files in the " + outdir + "/ directory!\n") # Make sure there is actually a configuration file config_file_dir = os.path.join(cwd, "config.py") if not os.path.exists(config_file_dir): sys.exit( "The...
[ "def", "send_ftp", "(", "outdir", ")", ":", "print", "(", "\"Uploading the files in the \"", "+", "outdir", "+", "\"/ directory!\\n\"", ")", "# Make sure there is actually a configuration file", "config_file_dir", "=", "os", ".", "path", ".", "join", "(", "cwd", ",", ...
Upload the built website to FTP
[ "Upload", "the", "built", "website", "to", "FTP" ]
e5865a8633e461a22c86ef6ee98cdd7051c412ac
https://github.com/BlendedSiteGenerator/Blended/blob/e5865a8633e461a22c86ef6ee98cdd7051c412ac/blended/__main__.py#L203-L239
56,086
BlendedSiteGenerator/Blended
blended/__main__.py
clean_built
def clean_built(outdir): """Removes all built files""" print("Removing the built files!") # Remove the build folder build_dir = os.path.join(cwd, outdir) if os.path.exists(build_dir): shutil.rmtree(build_dir)
python
def clean_built(outdir): """Removes all built files""" print("Removing the built files!") # Remove the build folder build_dir = os.path.join(cwd, outdir) if os.path.exists(build_dir): shutil.rmtree(build_dir)
[ "def", "clean_built", "(", "outdir", ")", ":", "print", "(", "\"Removing the built files!\"", ")", "# Remove the build folder", "build_dir", "=", "os", ".", "path", ".", "join", "(", "cwd", ",", "outdir", ")", "if", "os", ".", "path", ".", "exists", "(", ...
Removes all built files
[ "Removes", "all", "built", "files" ]
e5865a8633e461a22c86ef6ee98cdd7051c412ac
https://github.com/BlendedSiteGenerator/Blended/blob/e5865a8633e461a22c86ef6ee98cdd7051c412ac/blended/__main__.py#L244-L251
56,087
BlendedSiteGenerator/Blended
blended/__main__.py
zip_built
def zip_built(outdir): """Packages the build folder into a zip""" print("Zipping the built files!") config_file_dir = os.path.join(cwd, "config.py") if not os.path.exists(config_file_dir): sys.exit( "There dosen't seem to be a configuration file. Have you run the init command?") ...
python
def zip_built(outdir): """Packages the build folder into a zip""" print("Zipping the built files!") config_file_dir = os.path.join(cwd, "config.py") if not os.path.exists(config_file_dir): sys.exit( "There dosen't seem to be a configuration file. Have you run the init command?") ...
[ "def", "zip_built", "(", "outdir", ")", ":", "print", "(", "\"Zipping the built files!\"", ")", "config_file_dir", "=", "os", ".", "path", ".", "join", "(", "cwd", ",", "\"config.py\"", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "config_file_...
Packages the build folder into a zip
[ "Packages", "the", "build", "folder", "into", "a", "zip" ]
e5865a8633e461a22c86ef6ee98cdd7051c412ac
https://github.com/BlendedSiteGenerator/Blended/blob/e5865a8633e461a22c86ef6ee98cdd7051c412ac/blended/__main__.py#L256-L280
56,088
BlendedSiteGenerator/Blended
blended/__main__.py
purge
def purge(): """Removes all files generated by Blended""" print("Purging the Blended files!") # Remove the templates folder templ_dir = os.path.join(cwd, "templates") if os.path.exists(templ_dir): shutil.rmtree(templ_dir) # Remove the content folder cont_dir = os.path.join(cwd, "co...
python
def purge(): """Removes all files generated by Blended""" print("Purging the Blended files!") # Remove the templates folder templ_dir = os.path.join(cwd, "templates") if os.path.exists(templ_dir): shutil.rmtree(templ_dir) # Remove the content folder cont_dir = os.path.join(cwd, "co...
[ "def", "purge", "(", ")", ":", "print", "(", "\"Purging the Blended files!\"", ")", "# Remove the templates folder", "templ_dir", "=", "os", ".", "path", ".", "join", "(", "cwd", ",", "\"templates\"", ")", "if", "os", ".", "path", ".", "exists", "(", "templ_...
Removes all files generated by Blended
[ "Removes", "all", "files", "generated", "by", "Blended" ]
e5865a8633e461a22c86ef6ee98cdd7051c412ac
https://github.com/BlendedSiteGenerator/Blended/blob/e5865a8633e461a22c86ef6ee98cdd7051c412ac/blended/__main__.py#L284-L316
56,089
BlendedSiteGenerator/Blended
blended/__main__.py
build
def build(outdir): """Blends the generated files and outputs a HTML website""" print("Building your Blended files into a website!") reload(sys) sys.setdefaultencoding('utf8') build_files(outdir) print("The files are built! You can find them in the " + outdir + "/ directory. Run the...
python
def build(outdir): """Blends the generated files and outputs a HTML website""" print("Building your Blended files into a website!") reload(sys) sys.setdefaultencoding('utf8') build_files(outdir) print("The files are built! You can find them in the " + outdir + "/ directory. Run the...
[ "def", "build", "(", "outdir", ")", ":", "print", "(", "\"Building your Blended files into a website!\"", ")", "reload", "(", "sys", ")", "sys", ".", "setdefaultencoding", "(", "'utf8'", ")", "build_files", "(", "outdir", ")", "print", "(", "\"The files are built!...
Blends the generated files and outputs a HTML website
[ "Blends", "the", "generated", "files", "and", "outputs", "a", "HTML", "website" ]
e5865a8633e461a22c86ef6ee98cdd7051c412ac
https://github.com/BlendedSiteGenerator/Blended/blob/e5865a8633e461a22c86ef6ee98cdd7051c412ac/blended/__main__.py#L718-L729
56,090
BlendedSiteGenerator/Blended
blended/__main__.py
interactive
def interactive(outdir): """Blends the generated files and outputs a HTML website on file change""" print("Building your Blended files into a website!") global outdir_type outdir_type = outdir reload(sys) sys.setdefaultencoding('utf8') build_files(outdir) print("Watching the content...
python
def interactive(outdir): """Blends the generated files and outputs a HTML website on file change""" print("Building your Blended files into a website!") global outdir_type outdir_type = outdir reload(sys) sys.setdefaultencoding('utf8') build_files(outdir) print("Watching the content...
[ "def", "interactive", "(", "outdir", ")", ":", "print", "(", "\"Building your Blended files into a website!\"", ")", "global", "outdir_type", "outdir_type", "=", "outdir", "reload", "(", "sys", ")", "sys", ".", "setdefaultencoding", "(", "'utf8'", ")", "build_files"...
Blends the generated files and outputs a HTML website on file change
[ "Blends", "the", "generated", "files", "and", "outputs", "a", "HTML", "website", "on", "file", "change" ]
e5865a8633e461a22c86ef6ee98cdd7051c412ac
https://github.com/BlendedSiteGenerator/Blended/blob/e5865a8633e461a22c86ef6ee98cdd7051c412ac/blended/__main__.py#L792-L808
56,091
BlendedSiteGenerator/Blended
blended/__main__.py
view
def view(outdir): """Opens the built index.html file in a web browser""" index_path = os.path.realpath(os.path.join(cwd, outdir, "index.html")) if os.path.exists(index_path): webbrowser.open('file://' + index_path) else: print("The index.html file could not be found in the " + outdir + ...
python
def view(outdir): """Opens the built index.html file in a web browser""" index_path = os.path.realpath(os.path.join(cwd, outdir, "index.html")) if os.path.exists(index_path): webbrowser.open('file://' + index_path) else: print("The index.html file could not be found in the " + outdir + ...
[ "def", "view", "(", "outdir", ")", ":", "index_path", "=", "os", ".", "path", ".", "realpath", "(", "os", ".", "path", ".", "join", "(", "cwd", ",", "outdir", ",", "\"index.html\"", ")", ")", "if", "os", ".", "path", ".", "exists", "(", "index_path...
Opens the built index.html file in a web browser
[ "Opens", "the", "built", "index", ".", "html", "file", "in", "a", "web", "browser" ]
e5865a8633e461a22c86ef6ee98cdd7051c412ac
https://github.com/BlendedSiteGenerator/Blended/blob/e5865a8633e461a22c86ef6ee98cdd7051c412ac/blended/__main__.py#L813-L821
56,092
BlendedSiteGenerator/Blended
blended/__main__.py
Watcher.run
def run(self): """Run the builder on changes""" event_handler = Handler() threads = [] paths = [os.path.join(cwd, "content"), os.path.join(cwd, "templates")] for i in paths: targetPath = str(i) self.observer.schedule(event_handler, targetPath, recursive=T...
python
def run(self): """Run the builder on changes""" event_handler = Handler() threads = [] paths = [os.path.join(cwd, "content"), os.path.join(cwd, "templates")] for i in paths: targetPath = str(i) self.observer.schedule(event_handler, targetPath, recursive=T...
[ "def", "run", "(", "self", ")", ":", "event_handler", "=", "Handler", "(", ")", "threads", "=", "[", "]", "paths", "=", "[", "os", ".", "path", ".", "join", "(", "cwd", ",", "\"content\"", ")", ",", "os", ".", "path", ".", "join", "(", "cwd", "...
Run the builder on changes
[ "Run", "the", "builder", "on", "changes" ]
e5865a8633e461a22c86ef6ee98cdd7051c412ac
https://github.com/BlendedSiteGenerator/Blended/blob/e5865a8633e461a22c86ef6ee98cdd7051c412ac/blended/__main__.py#L742-L762
56,093
darxtrix/lehar
lehar/main.py
_sanitize_numbers
def _sanitize_numbers(uncleaned_numbers): """ Convert strings to integers if possible """ cleaned_numbers = [] for x in uncleaned_numbers: try: cleaned_numbers.append(int(x)) except ValueError: cleaned_numbers.append(x) return cleaned_numbers
python
def _sanitize_numbers(uncleaned_numbers): """ Convert strings to integers if possible """ cleaned_numbers = [] for x in uncleaned_numbers: try: cleaned_numbers.append(int(x)) except ValueError: cleaned_numbers.append(x) return cleaned_numbers
[ "def", "_sanitize_numbers", "(", "uncleaned_numbers", ")", ":", "cleaned_numbers", "=", "[", "]", "for", "x", "in", "uncleaned_numbers", ":", "try", ":", "cleaned_numbers", ".", "append", "(", "int", "(", "x", ")", ")", "except", "ValueError", ":", "cleaned_...
Convert strings to integers if possible
[ "Convert", "strings", "to", "integers", "if", "possible" ]
8a2fbeb2b38068dcb609d5dda37b24bd2bc6b343
https://github.com/darxtrix/lehar/blob/8a2fbeb2b38068dcb609d5dda37b24bd2bc6b343/lehar/main.py#L38-L48
56,094
darxtrix/lehar
lehar/main.py
_handle_negatives
def _handle_negatives(numbers): """ Add the minimum negative number to all the numbers in the such that all the elements become >= 0 """ min_number = min(filter(lambda x : type(x)==int,numbers)) if min_number < 0: return [x+abs(min_number) if type(x)==int else x for x in numbers]...
python
def _handle_negatives(numbers): """ Add the minimum negative number to all the numbers in the such that all the elements become >= 0 """ min_number = min(filter(lambda x : type(x)==int,numbers)) if min_number < 0: return [x+abs(min_number) if type(x)==int else x for x in numbers]...
[ "def", "_handle_negatives", "(", "numbers", ")", ":", "min_number", "=", "min", "(", "filter", "(", "lambda", "x", ":", "type", "(", "x", ")", "==", "int", ",", "numbers", ")", ")", "if", "min_number", "<", "0", ":", "return", "[", "x", "+", "abs",...
Add the minimum negative number to all the numbers in the such that all the elements become >= 0
[ "Add", "the", "minimum", "negative", "number", "to", "all", "the", "numbers", "in", "the", "such", "that", "all", "the", "elements", "become", ">", "=", "0" ]
8a2fbeb2b38068dcb609d5dda37b24bd2bc6b343
https://github.com/darxtrix/lehar/blob/8a2fbeb2b38068dcb609d5dda37b24bd2bc6b343/lehar/main.py#L51-L60
56,095
darxtrix/lehar
lehar/main.py
_draw_tickgram
def _draw_tickgram(numbers): """ Takes a list of integers and generate the equivalent list of ticks corresponding to each of the number """ max_number = max(filter(lambda x : type(x)==int,numbers)) # If the maxium number is 0, then all the numbers should be 0 # coz we have called ha...
python
def _draw_tickgram(numbers): """ Takes a list of integers and generate the equivalent list of ticks corresponding to each of the number """ max_number = max(filter(lambda x : type(x)==int,numbers)) # If the maxium number is 0, then all the numbers should be 0 # coz we have called ha...
[ "def", "_draw_tickgram", "(", "numbers", ")", ":", "max_number", "=", "max", "(", "filter", "(", "lambda", "x", ":", "type", "(", "x", ")", "==", "int", ",", "numbers", ")", ")", "# If the maxium number is 0, then all the numbers should be 0", "# coz we have calle...
Takes a list of integers and generate the equivalent list of ticks corresponding to each of the number
[ "Takes", "a", "list", "of", "integers", "and", "generate", "the", "equivalent", "list", "of", "ticks", "corresponding", "to", "each", "of", "the", "number" ]
8a2fbeb2b38068dcb609d5dda37b24bd2bc6b343
https://github.com/darxtrix/lehar/blob/8a2fbeb2b38068dcb609d5dda37b24bd2bc6b343/lehar/main.py#L63-L76
56,096
INM-6/hybridLFPy
examples/Hagen_et_al_2016_cercor/nest_output_processing.py
get_raw_gids
def get_raw_gids(model_params): ''' Reads text file containing gids of neuron populations as created within the NEST simulation. These gids are not continuous as in the simulation devices get created in between. ''' gidfile = open(os.path.join(model_params.raw_nest_output_path, ...
python
def get_raw_gids(model_params): ''' Reads text file containing gids of neuron populations as created within the NEST simulation. These gids are not continuous as in the simulation devices get created in between. ''' gidfile = open(os.path.join(model_params.raw_nest_output_path, ...
[ "def", "get_raw_gids", "(", "model_params", ")", ":", "gidfile", "=", "open", "(", "os", ".", "path", ".", "join", "(", "model_params", ".", "raw_nest_output_path", ",", "model_params", ".", "GID_filename", ")", ",", "'r'", ")", "gids", "=", "[", "]", "f...
Reads text file containing gids of neuron populations as created within the NEST simulation. These gids are not continuous as in the simulation devices get created in between.
[ "Reads", "text", "file", "containing", "gids", "of", "neuron", "populations", "as", "created", "within", "the", "NEST", "simulation", ".", "These", "gids", "are", "not", "continuous", "as", "in", "the", "simulation", "devices", "get", "created", "in", "between...
c38bdf38982c4624c2f70caeb50c40f1d5980abd
https://github.com/INM-6/hybridLFPy/blob/c38bdf38982c4624c2f70caeb50c40f1d5980abd/examples/Hagen_et_al_2016_cercor/nest_output_processing.py#L25-L37
56,097
BlendedSiteGenerator/Blended
blended/functions.py
replace_folder
def replace_folder(path): """If the specified folder exists, it is deleted and recreated""" if os.path.exists(path): shutil.rmtree(path) os.makedirs(path) else: os.makedirs(path)
python
def replace_folder(path): """If the specified folder exists, it is deleted and recreated""" if os.path.exists(path): shutil.rmtree(path) os.makedirs(path) else: os.makedirs(path)
[ "def", "replace_folder", "(", "path", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "path", ")", ":", "shutil", ".", "rmtree", "(", "path", ")", "os", ".", "makedirs", "(", "path", ")", "else", ":", "os", ".", "makedirs", "(", "path", ")...
If the specified folder exists, it is deleted and recreated
[ "If", "the", "specified", "folder", "exists", "it", "is", "deleted", "and", "recreated" ]
e5865a8633e461a22c86ef6ee98cdd7051c412ac
https://github.com/BlendedSiteGenerator/Blended/blob/e5865a8633e461a22c86ef6ee98cdd7051c412ac/blended/functions.py#L24-L30
56,098
BlendedSiteGenerator/Blended
blended/functions.py
get_html_filename
def get_html_filename(filename): """Converts the filename to a .html extension""" if ".html" in filename: newFilename = filename elif ".md" in filename: newFilename = filename.replace(".md", ".html") elif ".tile" in filename: newFilename = filename.replace(".tile", ".html") e...
python
def get_html_filename(filename): """Converts the filename to a .html extension""" if ".html" in filename: newFilename = filename elif ".md" in filename: newFilename = filename.replace(".md", ".html") elif ".tile" in filename: newFilename = filename.replace(".tile", ".html") e...
[ "def", "get_html_filename", "(", "filename", ")", ":", "if", "\".html\"", "in", "filename", ":", "newFilename", "=", "filename", "elif", "\".md\"", "in", "filename", ":", "newFilename", "=", "filename", ".", "replace", "(", "\".md\"", ",", "\".html\"", ")", ...
Converts the filename to a .html extension
[ "Converts", "the", "filename", "to", "a", ".", "html", "extension" ]
e5865a8633e461a22c86ef6ee98cdd7051c412ac
https://github.com/BlendedSiteGenerator/Blended/blob/e5865a8633e461a22c86ef6ee98cdd7051c412ac/blended/functions.py#L33-L52
56,099
BlendedSiteGenerator/Blended
blended/functions.py
get_html_clear_filename
def get_html_clear_filename(filename): """Clears the file extension from the filename and makes it nice looking""" newFilename = filename.replace(".html", "") newFilename = newFilename.replace(".md", "") newFilename = newFilename.replace(".txt", "") newFilename = newFilename.replace(".tile", "") ...
python
def get_html_clear_filename(filename): """Clears the file extension from the filename and makes it nice looking""" newFilename = filename.replace(".html", "") newFilename = newFilename.replace(".md", "") newFilename = newFilename.replace(".txt", "") newFilename = newFilename.replace(".tile", "") ...
[ "def", "get_html_clear_filename", "(", "filename", ")", ":", "newFilename", "=", "filename", ".", "replace", "(", "\".html\"", ",", "\"\"", ")", "newFilename", "=", "newFilename", ".", "replace", "(", "\".md\"", ",", "\"\"", ")", "newFilename", "=", "newFilena...
Clears the file extension from the filename and makes it nice looking
[ "Clears", "the", "file", "extension", "from", "the", "filename", "and", "makes", "it", "nice", "looking" ]
e5865a8633e461a22c86ef6ee98cdd7051c412ac
https://github.com/BlendedSiteGenerator/Blended/blob/e5865a8633e461a22c86ef6ee98cdd7051c412ac/blended/functions.py#L55-L69