body
stringlengths
26
98.2k
body_hash
int64
-9,222,864,604,528,158,000
9,221,803,474B
docstring
stringlengths
1
16.8k
path
stringlengths
5
230
name
stringlengths
1
96
repository_name
stringlengths
7
89
lang
stringclasses
1 value
body_without_docstring
stringlengths
20
98.2k
@property def z(self): "\n Sets the aggregation data.\n\n The 'z' property is an array that may be specified as a tuple,\n list, numpy array, or pandas Series\n\n Returns\n -------\n numpy.ndarray\n " return self['z']
989,078,158,267,727,900
Sets the aggregation data. The 'z' property is an array that may be specified as a tuple, list, numpy array, or pandas Series Returns ------- numpy.ndarray
packages/python/plotly/plotly/graph_objs/_histogram2dcontour.py
z
labaran1/plotly.py
python
@property def z(self): "\n Sets the aggregation data.\n\n The 'z' property is an array that may be specified as a tuple,\n list, numpy array, or pandas Series\n\n Returns\n -------\n numpy.ndarray\n " return self['z']
@property def zauto(self): "\n Determines whether or not the color domain is computed with\n respect to the input data (here in `z`) or the bounds set in\n `zmin` and `zmax` Defaults to `false` when `zmin` and `zmax`\n are set by the user.\n\n The 'zauto' property must be specifie...
1,912,562,263,594,213,400
Determines whether or not the color domain is computed with respect to the input data (here in `z`) or the bounds set in `zmin` and `zmax` Defaults to `false` when `zmin` and `zmax` are set by the user. The 'zauto' property must be specified as a bool (either True, or False) Returns ------- bool
packages/python/plotly/plotly/graph_objs/_histogram2dcontour.py
zauto
labaran1/plotly.py
python
@property def zauto(self): "\n Determines whether or not the color domain is computed with\n respect to the input data (here in `z`) or the bounds set in\n `zmin` and `zmax` Defaults to `false` when `zmin` and `zmax`\n are set by the user.\n\n The 'zauto' property must be specifie...
@property def zhoverformat(self): "\n Sets the hover text formatting rulefor `z` using d3 formatting\n mini-languages which are very similar to those in Python. For\n numbers, see:\n https://github.com/d3/d3-format/tree/v1.4.5#d3-format.By\n default the values are formatted using...
-2,554,998,917,856,491,500
Sets the hover text formatting rulefor `z` using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format.By default the values are formatted using generic number format. The 'zhoverformat' property is a string and must be specifie...
packages/python/plotly/plotly/graph_objs/_histogram2dcontour.py
zhoverformat
labaran1/plotly.py
python
@property def zhoverformat(self): "\n Sets the hover text formatting rulefor `z` using d3 formatting\n mini-languages which are very similar to those in Python. For\n numbers, see:\n https://github.com/d3/d3-format/tree/v1.4.5#d3-format.By\n default the values are formatted using...
@property def zmax(self): "\n Sets the upper bound of the color domain. Value should have the\n same units as in `z` and if set, `zmin` must be set as well.\n\n The 'zmax' property is a number and may be specified as:\n - An int or float\n\n Returns\n -------\n int...
-230,201,867,242,881,380
Sets the upper bound of the color domain. Value should have the same units as in `z` and if set, `zmin` must be set as well. The 'zmax' property is a number and may be specified as: - An int or float Returns ------- int|float
packages/python/plotly/plotly/graph_objs/_histogram2dcontour.py
zmax
labaran1/plotly.py
python
@property def zmax(self): "\n Sets the upper bound of the color domain. Value should have the\n same units as in `z` and if set, `zmin` must be set as well.\n\n The 'zmax' property is a number and may be specified as:\n - An int or float\n\n Returns\n -------\n int...
@property def zmid(self): "\n Sets the mid-point of the color domain by scaling `zmin` and/or\n `zmax` to be equidistant to this point. Value should have the\n same units as in `z`. Has no effect when `zauto` is `false`.\n\n The 'zmid' property is a number and may be specified as:\n ...
8,848,989,567,395,846,000
Sets the mid-point of the color domain by scaling `zmin` and/or `zmax` to be equidistant to this point. Value should have the same units as in `z`. Has no effect when `zauto` is `false`. The 'zmid' property is a number and may be specified as: - An int or float Returns ------- int|float
packages/python/plotly/plotly/graph_objs/_histogram2dcontour.py
zmid
labaran1/plotly.py
python
@property def zmid(self): "\n Sets the mid-point of the color domain by scaling `zmin` and/or\n `zmax` to be equidistant to this point. Value should have the\n same units as in `z`. Has no effect when `zauto` is `false`.\n\n The 'zmid' property is a number and may be specified as:\n ...
@property def zmin(self): "\n Sets the lower bound of the color domain. Value should have the\n same units as in `z` and if set, `zmax` must be set as well.\n\n The 'zmin' property is a number and may be specified as:\n - An int or float\n\n Returns\n -------\n int...
-7,033,344,151,506,177,000
Sets the lower bound of the color domain. Value should have the same units as in `z` and if set, `zmax` must be set as well. The 'zmin' property is a number and may be specified as: - An int or float Returns ------- int|float
packages/python/plotly/plotly/graph_objs/_histogram2dcontour.py
zmin
labaran1/plotly.py
python
@property def zmin(self): "\n Sets the lower bound of the color domain. Value should have the\n same units as in `z` and if set, `zmax` must be set as well.\n\n The 'zmin' property is a number and may be specified as:\n - An int or float\n\n Returns\n -------\n int...
@property def zsrc(self): "\n Sets the source reference on Chart Studio Cloud for `z`.\n\n The 'zsrc' property must be specified as a string or\n as a plotly.grid_objs.Column object\n\n Returns\n -------\n str\n " return self['zsrc']
3,882,254,053,371,198,500
Sets the source reference on Chart Studio Cloud for `z`. The 'zsrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str
packages/python/plotly/plotly/graph_objs/_histogram2dcontour.py
zsrc
labaran1/plotly.py
python
@property def zsrc(self): "\n Sets the source reference on Chart Studio Cloud for `z`.\n\n The 'zsrc' property must be specified as a string or\n as a plotly.grid_objs.Column object\n\n Returns\n -------\n str\n " return self['zsrc']
def __init__(self, arg=None, autobinx=None, autobiny=None, autocolorscale=None, autocontour=None, bingroup=None, coloraxis=None, colorbar=None, colorscale=None, contours=None, customdata=None, customdatasrc=None, histfunc=None, histnorm=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hover...
-2,595,120,491,532,694,500
Construct a new Histogram2dContour object The sample data from which statistics are computed is set in `x` and `y` (where `x` and `y` represent marginal distributions, binning is set in `xbins` and `ybins` in this case) or `z` (where `z` represent the 2D distribution and binning set, binning is set by `x` and `y` in t...
packages/python/plotly/plotly/graph_objs/_histogram2dcontour.py
__init__
labaran1/plotly.py
python
def __init__(self, arg=None, autobinx=None, autobiny=None, autocolorscale=None, autocontour=None, bingroup=None, coloraxis=None, colorbar=None, colorscale=None, contours=None, customdata=None, customdatasrc=None, histfunc=None, histnorm=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hover...
def get_db_dir(): '\n Just return the default dir listed above\n :return: the default location for the sqllite database\n ' return defaultdir
-7,457,437,982,406,235,000
Just return the default dir listed above :return: the default location for the sqllite database
taxon/config.py
get_db_dir
linsalrob/EdwardsLab
python
def get_db_dir(): '\n Just return the default dir listed above\n :return: the default location for the sqllite database\n ' return defaultdir
def compute_corr_mse_accel_gyro(self, exclude_col_names: list=[], accel_column_names: list=['accelerometer_x', 'accelerometer_y', 'accelerometer_z'], gyro_column_names: list=['gyroscope_y', 'gyroscope_x', 'gyroscope_z'], windowDuration: int=None, slideDuration: int=None, groupByColumnName: List[str]=[], startTime=None)...
3,432,307,631,600,157,000
Compute correlation and mean standard error of accel and gyro sensors Args: exclude_col_names list(str): name of the columns on which features should not be computed accel_column_names list(str): name of accel data column gyro_column_names list(str): name of gyro data column windowDuration (int): durat...
cerebralcortex/markers/brushing/features.py
compute_corr_mse_accel_gyro
MD2Korg/CerebralCortex-2.0
python
def compute_corr_mse_accel_gyro(self, exclude_col_names: list=[], accel_column_names: list=['accelerometer_x', 'accelerometer_y', 'accelerometer_z'], gyro_column_names: list=['gyroscope_y', 'gyroscope_x', 'gyroscope_z'], windowDuration: int=None, slideDuration: int=None, groupByColumnName: List[str]=[], startTime=None)...
def compute_fourier_features(self, exclude_col_names: list=[], feature_names=['fft_centroid', 'fft_spread', 'spectral_entropy', 'spectral_entropy_old', 'fft_flux', 'spectral_falloff'], windowDuration: int=None, slideDuration: int=None, groupByColumnName: List[str]=[], startTime=None): '\n Transforms data from ti...
-5,459,656,174,276,873,000
Transforms data from time domain to frequency domain. Args: exclude_col_names list(str): name of the columns on which features should not be computed feature_names list(str): names of the features. Supported features are fft_centroid, fft_spread, spectral_entropy, spectral_entropy_old, fft_flux, spectral_fallo...
cerebralcortex/markers/brushing/features.py
compute_fourier_features
MD2Korg/CerebralCortex-2.0
python
def compute_fourier_features(self, exclude_col_names: list=[], feature_names=['fft_centroid', 'fft_spread', 'spectral_entropy', 'spectral_entropy_old', 'fft_flux', 'spectral_falloff'], windowDuration: int=None, slideDuration: int=None, groupByColumnName: List[str]=[], startTime=None): '\n Transforms data from ti...
def stSpectralCentroidAndSpread(X, fs): 'Computes spectral centroid of frame (given abs(FFT))' ind = (np.arange(1, (len(X) + 1)) * (fs / (2.0 * len(X)))) Xt = X.copy() Xt = (Xt / Xt.max()) NUM = np.sum((ind * Xt)) DEN = (np.sum(Xt) + eps) C = (NUM / DEN) S = np.sqrt((np.sum((((ind - C) *...
917,355,619,372,886,900
Computes spectral centroid of frame (given abs(FFT))
cerebralcortex/markers/brushing/features.py
stSpectralCentroidAndSpread
MD2Korg/CerebralCortex-2.0
python
def stSpectralCentroidAndSpread(X, fs): ind = (np.arange(1, (len(X) + 1)) * (fs / (2.0 * len(X)))) Xt = X.copy() Xt = (Xt / Xt.max()) NUM = np.sum((ind * Xt)) DEN = (np.sum(Xt) + eps) C = (NUM / DEN) S = np.sqrt((np.sum((((ind - C) ** 2) * Xt)) / DEN)) C = (C / (fs / 2.0)) S = (...
def stSpectralFlux(X, Xprev): '\n Computes the spectral flux feature of the current frame\n ARGUMENTS:\n X: the abs(fft) of the current frame\n Xpre: the abs(fft) of the previous frame\n ' sumX = np.sum((X + eps)) sumPrevX = np.sum((Xprev + eps)) ...
401,404,339,568,127,550
Computes the spectral flux feature of the current frame ARGUMENTS: X: the abs(fft) of the current frame Xpre: the abs(fft) of the previous frame
cerebralcortex/markers/brushing/features.py
stSpectralFlux
MD2Korg/CerebralCortex-2.0
python
def stSpectralFlux(X, Xprev): '\n Computes the spectral flux feature of the current frame\n ARGUMENTS:\n X: the abs(fft) of the current frame\n Xpre: the abs(fft) of the previous frame\n ' sumX = np.sum((X + eps)) sumPrevX = np.sum((Xprev + eps)) ...
def stSpectralRollOff(X, c, fs): 'Computes spectral roll-off' totalEnergy = np.sum((X ** 2)) fftLength = len(X) Thres = (c * totalEnergy) CumSum = (np.cumsum((X ** 2)) + eps) [a] = np.nonzero((CumSum > Thres)) if (len(a) > 0): mC = (np.float64(a[0]) / float(fftLength)) else: ...
413,782,549,393,534,600
Computes spectral roll-off
cerebralcortex/markers/brushing/features.py
stSpectralRollOff
MD2Korg/CerebralCortex-2.0
python
def stSpectralRollOff(X, c, fs): totalEnergy = np.sum((X ** 2)) fftLength = len(X) Thres = (c * totalEnergy) CumSum = (np.cumsum((X ** 2)) + eps) [a] = np.nonzero((CumSum > Thres)) if (len(a) > 0): mC = (np.float64(a[0]) / float(fftLength)) else: mC = 0.0 return mC
def stSpectralEntropy(X, numOfShortBlocks=10): 'Computes the spectral entropy' L = len(X) Eol = np.sum((X ** 2)) subWinLength = int(np.floor((L / numOfShortBlocks))) if (L != (subWinLength * numOfShortBlocks)): X = X[0:(subWinLength * numOfShortBlocks)] subWindows = X.reshape(subWinLengt...
-8,852,138,835,898,820,000
Computes the spectral entropy
cerebralcortex/markers/brushing/features.py
stSpectralEntropy
MD2Korg/CerebralCortex-2.0
python
def stSpectralEntropy(X, numOfShortBlocks=10): L = len(X) Eol = np.sum((X ** 2)) subWinLength = int(np.floor((L / numOfShortBlocks))) if (L != (subWinLength * numOfShortBlocks)): X = X[0:(subWinLength * numOfShortBlocks)] subWindows = X.reshape(subWinLength, numOfShortBlocks, order='F')...
def __init__(self, after=None, link=None, local_vars_configuration=None): 'NextPage - a model defined in OpenAPI' if (local_vars_configuration is None): local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration self._after = None self._link = None ...
-554,981,027,761,478,850
NextPage - a model defined in OpenAPI
hubspot/files/files/models/next_page.py
__init__
Catchoom/hubspot-api-python
python
def __init__(self, after=None, link=None, local_vars_configuration=None): if (local_vars_configuration is None): local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration self._after = None self._link = None self.discriminator = None self.af...
@property def after(self): 'Gets the after of this NextPage. # noqa: E501\n\n\n :return: The after of this NextPage. # noqa: E501\n :rtype: str\n ' return self._after
-8,255,473,615,383,818,000
Gets the after of this NextPage. # noqa: E501 :return: The after of this NextPage. # noqa: E501 :rtype: str
hubspot/files/files/models/next_page.py
after
Catchoom/hubspot-api-python
python
@property def after(self): 'Gets the after of this NextPage. # noqa: E501\n\n\n :return: The after of this NextPage. # noqa: E501\n :rtype: str\n ' return self._after
@after.setter def after(self, after): 'Sets the after of this NextPage.\n\n\n :param after: The after of this NextPage. # noqa: E501\n :type: str\n ' if (self.local_vars_configuration.client_side_validation and (after is None)): raise ValueError('Invalid value for `after`, must not...
-7,818,888,564,485,552,000
Sets the after of this NextPage. :param after: The after of this NextPage. # noqa: E501 :type: str
hubspot/files/files/models/next_page.py
after
Catchoom/hubspot-api-python
python
@after.setter def after(self, after): 'Sets the after of this NextPage.\n\n\n :param after: The after of this NextPage. # noqa: E501\n :type: str\n ' if (self.local_vars_configuration.client_side_validation and (after is None)): raise ValueError('Invalid value for `after`, must not...
@property def link(self): 'Gets the link of this NextPage. # noqa: E501\n\n\n :return: The link of this NextPage. # noqa: E501\n :rtype: str\n ' return self._link
5,843,383,549,101,338,000
Gets the link of this NextPage. # noqa: E501 :return: The link of this NextPage. # noqa: E501 :rtype: str
hubspot/files/files/models/next_page.py
link
Catchoom/hubspot-api-python
python
@property def link(self): 'Gets the link of this NextPage. # noqa: E501\n\n\n :return: The link of this NextPage. # noqa: E501\n :rtype: str\n ' return self._link
@link.setter def link(self, link): 'Sets the link of this NextPage.\n\n\n :param link: The link of this NextPage. # noqa: E501\n :type: str\n ' self._link = link
6,429,752,145,295,531,000
Sets the link of this NextPage. :param link: The link of this NextPage. # noqa: E501 :type: str
hubspot/files/files/models/next_page.py
link
Catchoom/hubspot-api-python
python
@link.setter def link(self, link): 'Sets the link of this NextPage.\n\n\n :param link: The link of this NextPage. # noqa: E501\n :type: str\n ' self._link = link
def to_dict(self): 'Returns the model properties as a dict' result = {} for (attr, _) in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value)) e...
8,442,519,487,048,767,000
Returns the model properties as a dict
hubspot/files/files/models/next_page.py
to_dict
Catchoom/hubspot-api-python
python
def to_dict(self): result = {} for (attr, _) in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value)) elif hasattr(value, 'to_dict'): ...
def to_str(self): 'Returns the string representation of the model' return pprint.pformat(self.to_dict())
5,849,158,643,760,736,000
Returns the string representation of the model
hubspot/files/files/models/next_page.py
to_str
Catchoom/hubspot-api-python
python
def to_str(self): return pprint.pformat(self.to_dict())
def __repr__(self): 'For `print` and `pprint`' return self.to_str()
-8,960,031,694,814,905,000
For `print` and `pprint`
hubspot/files/files/models/next_page.py
__repr__
Catchoom/hubspot-api-python
python
def __repr__(self): return self.to_str()
def __eq__(self, other): 'Returns true if both objects are equal' if (not isinstance(other, NextPage)): return False return (self.to_dict() == other.to_dict())
-7,321,777,463,093,585,000
Returns true if both objects are equal
hubspot/files/files/models/next_page.py
__eq__
Catchoom/hubspot-api-python
python
def __eq__(self, other): if (not isinstance(other, NextPage)): return False return (self.to_dict() == other.to_dict())
def __ne__(self, other): 'Returns true if both objects are not equal' if (not isinstance(other, NextPage)): return True return (self.to_dict() != other.to_dict())
-1,624,190,676,302,696,700
Returns true if both objects are not equal
hubspot/files/files/models/next_page.py
__ne__
Catchoom/hubspot-api-python
python
def __ne__(self, other): if (not isinstance(other, NextPage)): return True return (self.to_dict() != other.to_dict())
def __init__(self, channel): 'Constructor.\n\n Args:\n channel: A grpc.Channel.\n ' self.GetFeedItemTarget = channel.unary_unary('/google.ads.googleads.v2.services.FeedItemTargetService/GetFeedItemTarget', request_serializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_feed__item__targ...
1,639,354,539,681,269,000
Constructor. Args: channel: A grpc.Channel.
google/ads/google_ads/v2/proto/services/feed_item_target_service_pb2_grpc.py
__init__
BenRKarl/google-ads-python
python
def __init__(self, channel): 'Constructor.\n\n Args:\n channel: A grpc.Channel.\n ' self.GetFeedItemTarget = channel.unary_unary('/google.ads.googleads.v2.services.FeedItemTargetService/GetFeedItemTarget', request_serializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_feed__item__targ...
def GetFeedItemTarget(self, request, context): 'Returns the requested feed item targets in full detail.\n ' context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
-4,225,013,039,427,472,000
Returns the requested feed item targets in full detail.
google/ads/google_ads/v2/proto/services/feed_item_target_service_pb2_grpc.py
GetFeedItemTarget
BenRKarl/google-ads-python
python
def GetFeedItemTarget(self, request, context): '\n ' context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
def MutateFeedItemTargets(self, request, context): 'Creates or removes feed item targets. Operation statuses are returned.\n ' context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
4,147,450,015,430,002,000
Creates or removes feed item targets. Operation statuses are returned.
google/ads/google_ads/v2/proto/services/feed_item_target_service_pb2_grpc.py
MutateFeedItemTargets
BenRKarl/google-ads-python
python
def MutateFeedItemTargets(self, request, context): '\n ' context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
def check_dir_exists(dirname='./pickles'): 'Check if given dirname exists This will contain all the pickle files.' if (not os.path.exists(dirname)): print('Directory to store pickes does not exist. Creating one now: ./pickles') os.mkdir(dirname)
1,241,679,966,958,779,100
Check if given dirname exists This will contain all the pickle files.
createpickles.py
check_dir_exists
ansrivas/keras-rest-server
python
def check_dir_exists(dirname='./pickles'): if (not os.path.exists(dirname)): print('Directory to store pickes does not exist. Creating one now: ./pickles') os.mkdir(dirname)
def save_x_y_scalar(X_train, Y_train): 'Use a normalization method on your current dataset and save the coefficients.\n\n Args:\n X_train: Input X_train\n Y_train: Lables Y_train\n Returns:\n Normalized X_train,Y_train ( currently using StandardScaler from scikit-learn)\n ' s...
-4,774,427,860,463,725,000
Use a normalization method on your current dataset and save the coefficients. Args: X_train: Input X_train Y_train: Lables Y_train Returns: Normalized X_train,Y_train ( currently using StandardScaler from scikit-learn)
createpickles.py
save_x_y_scalar
ansrivas/keras-rest-server
python
def save_x_y_scalar(X_train, Y_train): 'Use a normalization method on your current dataset and save the coefficients.\n\n Args:\n X_train: Input X_train\n Y_train: Lables Y_train\n Returns:\n Normalized X_train,Y_train ( currently using StandardScaler from scikit-learn)\n ' s...
def create_model(X_train, Y_train): 'create_model will create a very simple neural net model and save the weights in a predefined directory.\n\n Args:\n X_train: Input X_train\n Y_train: Lables Y_train\n ' xin = X_train.shape[1] model = Sequential() model.add(Dense(units=4, in...
-6,434,802,664,474,911,000
create_model will create a very simple neural net model and save the weights in a predefined directory. Args: X_train: Input X_train Y_train: Lables Y_train
createpickles.py
create_model
ansrivas/keras-rest-server
python
def create_model(X_train, Y_train): 'create_model will create a very simple neural net model and save the weights in a predefined directory.\n\n Args:\n X_train: Input X_train\n Y_train: Lables Y_train\n ' xin = X_train.shape[1] model = Sequential() model.add(Dense(units=4, in...
def resize_return_buffer(buf_, size_): ' callback function that resizes return buffer when it is too small\n Args:\n size_: size the return buffer needs to be\n ' try: if (not tls_var.buf): tls_var.buf = create_string_buffer(size_) tls_var.bufSize = size_ elif (tls_va...
-1,352,476,546,927,327,500
callback function that resizes return buffer when it is too small Args: size_: size the return buffer needs to be
senzing/g2/sdk/python/G2ConfigMgr.py
resize_return_buffer
GeoJamesJones/ArcGIS-Senzing-Prototype
python
def resize_return_buffer(buf_, size_): ' callback function that resizes return buffer when it is too small\n Args:\n size_: size the return buffer needs to be\n ' try: if (not tls_var.buf): tls_var.buf = create_string_buffer(size_) tls_var.bufSize = size_ elif (tls_va...
def initV2(self, module_name_, ini_params_, debug_=False): ' Initializes the G2 config manager\n This should only be called once per process.\n Args:\n moduleName: A short name given to this instance of the config module\n iniParams: A json document that contains G2 system param...
-1,780,151,840,131,302,000
Initializes the G2 config manager This should only be called once per process. Args: moduleName: A short name given to this instance of the config module iniParams: A json document that contains G2 system parameters. verboseLogging: Enable diagnostic logging which will arcpy.AddMessage a massive amount of i...
senzing/g2/sdk/python/G2ConfigMgr.py
initV2
GeoJamesJones/ArcGIS-Senzing-Prototype
python
def initV2(self, module_name_, ini_params_, debug_=False): ' Initializes the G2 config manager\n This should only be called once per process.\n Args:\n moduleName: A short name given to this instance of the config module\n iniParams: A json document that contains G2 system param...
def __init__(self): ' Class initialization\n ' try: if (os.name == 'nt'): self._lib_handle = cdll.LoadLibrary('G2.dll') else: self._lib_handle = cdll.LoadLibrary('libG2.so') except OSError as ex: arcpy.AddMessage('ERROR: Unable to load G2. Did you reme...
6,399,571,678,208,304,000
Class initialization
senzing/g2/sdk/python/G2ConfigMgr.py
__init__
GeoJamesJones/ArcGIS-Senzing-Prototype
python
def __init__(self): ' \n ' try: if (os.name == 'nt'): self._lib_handle = cdll.LoadLibrary('G2.dll') else: self._lib_handle = cdll.LoadLibrary('libG2.so') except OSError as ex: arcpy.AddMessage('ERROR: Unable to load G2. Did you remember to setup your e...
def prepareStringArgument(self, stringToPrepare): ' Internal processing function ' if (stringToPrepare == None): return None if (type(stringToPrepare) == str): return stringToPrepare.encode('utf-8') elif (type(stringToPrepare) == bytearray): return stringToPrepare.decode().encode...
8,941,194,383,144,176,000
Internal processing function
senzing/g2/sdk/python/G2ConfigMgr.py
prepareStringArgument
GeoJamesJones/ArcGIS-Senzing-Prototype
python
def prepareStringArgument(self, stringToPrepare): ' ' if (stringToPrepare == None): return None if (type(stringToPrepare) == str): return stringToPrepare.encode('utf-8') elif (type(stringToPrepare) == bytearray): return stringToPrepare.decode().encode('utf-8') elif (type(str...
def prepareIntArgument(self, valueToPrepare): ' Internal processing function ' ' This converts many types of values to an integer ' if (valueToPrepare == None): return None if (type(valueToPrepare) == str): return int(valueToPrepare.encode('utf-8')) elif (type(valueToPrepare) == byte...
8,874,652,037,414,881,000
Internal processing function
senzing/g2/sdk/python/G2ConfigMgr.py
prepareIntArgument
GeoJamesJones/ArcGIS-Senzing-Prototype
python
def prepareIntArgument(self, valueToPrepare): ' ' ' This converts many types of values to an integer ' if (valueToPrepare == None): return None if (type(valueToPrepare) == str): return int(valueToPrepare.encode('utf-8')) elif (type(valueToPrepare) == bytearray): return int(v...
def addConfig(self, configStr, configComments, configID): ' registers a new configuration document in the datastore\n ' _configStr = self.prepareStringArgument(configStr) _configComments = self.prepareStringArgument(configComments) configID[:] = b'' cID = c_longlong(0) self._lib_handle.G2...
7,767,073,802,886,320,000
registers a new configuration document in the datastore
senzing/g2/sdk/python/G2ConfigMgr.py
addConfig
GeoJamesJones/ArcGIS-Senzing-Prototype
python
def addConfig(self, configStr, configComments, configID): ' \n ' _configStr = self.prepareStringArgument(configStr) _configComments = self.prepareStringArgument(configComments) configID[:] = b cID = c_longlong(0) self._lib_handle.G2ConfigMgr_addConfig.argtypes = [c_char_p, c_char_p, POINT...
def getConfig(self, configID, response): ' retrieves the registered configuration document from the datastore\n ' configID_ = self.prepareIntArgument(configID) response[:] = b'' responseBuf = c_char_p(addressof(tls_var.buf)) responseSize = c_size_t(tls_var.bufSize) self._lib_handle.G2Conf...
-3,640,614,544,183,717,400
retrieves the registered configuration document from the datastore
senzing/g2/sdk/python/G2ConfigMgr.py
getConfig
GeoJamesJones/ArcGIS-Senzing-Prototype
python
def getConfig(self, configID, response): ' \n ' configID_ = self.prepareIntArgument(configID) response[:] = b responseBuf = c_char_p(addressof(tls_var.buf)) responseSize = c_size_t(tls_var.bufSize) self._lib_handle.G2ConfigMgr_getConfig.restype = c_int self._lib_handle.G2ConfigMgr_get...
def getConfigList(self, response): ' retrieves a list of known configurations from the datastore\n ' response[:] = b'' responseBuf = c_char_p(addressof(tls_var.buf)) responseSize = c_size_t(tls_var.bufSize) self._lib_handle.G2ConfigMgr_getConfigList.restype = c_int self._lib_handle.G2Conf...
6,758,571,486,106,685,000
retrieves a list of known configurations from the datastore
senzing/g2/sdk/python/G2ConfigMgr.py
getConfigList
GeoJamesJones/ArcGIS-Senzing-Prototype
python
def getConfigList(self, response): ' \n ' response[:] = b responseBuf = c_char_p(addressof(tls_var.buf)) responseSize = c_size_t(tls_var.bufSize) self._lib_handle.G2ConfigMgr_getConfigList.restype = c_int self._lib_handle.G2ConfigMgr_getConfigList.argtypes = [POINTER(c_char_p), POINTER(c_...
def setDefaultConfigID(self, configID): ' sets the default config identifier in the datastore\n ' configID_ = self.prepareIntArgument(configID) self._lib_handle.G2ConfigMgr_setDefaultConfigID.restype = c_int self._lib_handle.G2ConfigMgr_setDefaultConfigID.argtypes = [c_longlong] ret_code = se...
-7,938,155,852,795,214,000
sets the default config identifier in the datastore
senzing/g2/sdk/python/G2ConfigMgr.py
setDefaultConfigID
GeoJamesJones/ArcGIS-Senzing-Prototype
python
def setDefaultConfigID(self, configID): ' \n ' configID_ = self.prepareIntArgument(configID) self._lib_handle.G2ConfigMgr_setDefaultConfigID.restype = c_int self._lib_handle.G2ConfigMgr_setDefaultConfigID.argtypes = [c_longlong] ret_code = self._lib_handle.G2ConfigMgr_setDefaultConfigID(confi...
def replaceDefaultConfigID(self, oldConfigID, newConfigID): ' sets the default config identifier in the datastore\n ' oldConfigID_ = self.prepareIntArgument(oldConfigID) newConfigID_ = self.prepareIntArgument(newConfigID) self._lib_handle.G2ConfigMgr_replaceDefaultConfigID.restype = c_int sel...
6,423,434,265,841,057,000
sets the default config identifier in the datastore
senzing/g2/sdk/python/G2ConfigMgr.py
replaceDefaultConfigID
GeoJamesJones/ArcGIS-Senzing-Prototype
python
def replaceDefaultConfigID(self, oldConfigID, newConfigID): ' \n ' oldConfigID_ = self.prepareIntArgument(oldConfigID) newConfigID_ = self.prepareIntArgument(newConfigID) self._lib_handle.G2ConfigMgr_replaceDefaultConfigID.restype = c_int self._lib_handle.G2ConfigMgr_replaceDefaultConfigID.ar...
def getDefaultConfigID(self, configID): ' gets the default config identifier from the datastore\n ' configID[:] = b'' cID = c_longlong(0) self._lib_handle.G2ConfigMgr_getDefaultConfigID.argtypes = [POINTER(c_longlong)] self._lib_handle.G2ConfigMgr_getDefaultConfigID.restype = c_int ret_co...
3,663,798,139,632,863,000
gets the default config identifier from the datastore
senzing/g2/sdk/python/G2ConfigMgr.py
getDefaultConfigID
GeoJamesJones/ArcGIS-Senzing-Prototype
python
def getDefaultConfigID(self, configID): ' \n ' configID[:] = b cID = c_longlong(0) self._lib_handle.G2ConfigMgr_getDefaultConfigID.argtypes = [POINTER(c_longlong)] self._lib_handle.G2ConfigMgr_getDefaultConfigID.restype = c_int ret_code = self._lib_handle.G2ConfigMgr_getDefaultConfigID(cI...
def clearLastException(self): ' Clears the last exception\n ' self._lib_handle.G2ConfigMgr_clearLastException.restype = None self._lib_handle.G2ConfigMgr_clearLastException.argtypes = [] self._lib_handle.G2ConfigMgr_clearLastException()
8,328,367,716,224,782,000
Clears the last exception
senzing/g2/sdk/python/G2ConfigMgr.py
clearLastException
GeoJamesJones/ArcGIS-Senzing-Prototype
python
def clearLastException(self): ' \n ' self._lib_handle.G2ConfigMgr_clearLastException.restype = None self._lib_handle.G2ConfigMgr_clearLastException.argtypes = [] self._lib_handle.G2ConfigMgr_clearLastException()
def getLastException(self): ' Gets the last exception\n ' self._lib_handle.G2ConfigMgr_getLastException.restype = c_int self._lib_handle.G2ConfigMgr_getLastException.argtypes = [c_char_p, c_size_t] self._lib_handle.G2ConfigMgr_getLastException(tls_var.buf, sizeof(tls_var.buf)) resultString = ...
6,679,493,333,561,609,000
Gets the last exception
senzing/g2/sdk/python/G2ConfigMgr.py
getLastException
GeoJamesJones/ArcGIS-Senzing-Prototype
python
def getLastException(self): ' \n ' self._lib_handle.G2ConfigMgr_getLastException.restype = c_int self._lib_handle.G2ConfigMgr_getLastException.argtypes = [c_char_p, c_size_t] self._lib_handle.G2ConfigMgr_getLastException(tls_var.buf, sizeof(tls_var.buf)) resultString = tls_var.buf.value.decod...
def getLastExceptionCode(self): ' Gets the last exception code\n ' self._lib_handle.G2ConfigMgr_getLastExceptionCode.restype = c_int self._lib_handle.G2ConfigMgr_getLastExceptionCode.argtypes = [] exception_code = self._lib_handle.G2ConfigMgr_getLastExceptionCode() return exception_code
-2,972,673,154,366,856,700
Gets the last exception code
senzing/g2/sdk/python/G2ConfigMgr.py
getLastExceptionCode
GeoJamesJones/ArcGIS-Senzing-Prototype
python
def getLastExceptionCode(self): ' \n ' self._lib_handle.G2ConfigMgr_getLastExceptionCode.restype = c_int self._lib_handle.G2ConfigMgr_getLastExceptionCode.argtypes = [] exception_code = self._lib_handle.G2ConfigMgr_getLastExceptionCode() return exception_code
def destroy(self): ' Uninitializes the engine\n This should be done once per process after init(...) is called.\n After it is called the engine will no longer function.\n\n Args:\n\n Return:\n None\n ' self._lib_handle.G2ConfigMgr_destroy()
-8,557,166,857,811,240,000
Uninitializes the engine This should be done once per process after init(...) is called. After it is called the engine will no longer function. Args: Return: None
senzing/g2/sdk/python/G2ConfigMgr.py
destroy
GeoJamesJones/ArcGIS-Senzing-Prototype
python
def destroy(self): ' Uninitializes the engine\n This should be done once per process after init(...) is called.\n After it is called the engine will no longer function.\n\n Args:\n\n Return:\n None\n ' self._lib_handle.G2ConfigMgr_destroy()
def start(self): '\n start monitor,\n it will start a monitor thread.\n ' self.running_lock.acquire() self.running = True self.running_lock.release() self.fetch_thread.setDaemon(True) self.fetch_thread.start()
6,365,399,168,440,328,000
start monitor, it will start a monitor thread.
python/paddle/fluid/trainer_factory.py
start
0x45f/Paddle
python
def start(self): '\n start monitor,\n it will start a monitor thread.\n ' self.running_lock.acquire() self.running = True self.running_lock.release() self.fetch_thread.setDaemon(True) self.fetch_thread.start()
def update_board(self, position, flag=False): 'Takes position [x,y] as input\n\t\t\treturns a updated board as a string\n\t\t' x = (position[0] - 1) y = (position[1] - 1) if (flag == True): if (self.board_data[y][x] == ' ◌ '): self.board_data[y][x] = ' ▶ ' elif (self.board_da...
4,688,058,642,854,749,000
Takes position [x,y] as input returns a updated board as a string
board.py
update_board
Epirius/minesweeper
python
def update_board(self, position, flag=False): 'Takes position [x,y] as input\n\t\t\treturns a updated board as a string\n\t\t' x = (position[0] - 1) y = (position[1] - 1) if (flag == True): if (self.board_data[y][x] == ' ◌ '): self.board_data[y][x] = ' ▶ ' elif (self.board_da...
def clean_extra_package_management_files(): 'Removes either requirements files and folder or the Pipfile.' use_pipenv = '{{cookiecutter.use_pipenv}}' use_heroku = '{{cookiecutter.use_heroku}}' to_delete = [] if (use_pipenv == 'yes'): to_delete = (to_delete + ['requirements.txt', 'requirement...
1,898,375,103,263,794,700
Removes either requirements files and folder or the Pipfile.
hooks/post_gen_project.py
clean_extra_package_management_files
HaeckelK/cookiecutter-flask
python
def clean_extra_package_management_files(): use_pipenv = '{{cookiecutter.use_pipenv}}' use_heroku = '{{cookiecutter.use_heroku}}' to_delete = [] if (use_pipenv == 'yes'): to_delete = (to_delete + ['requirements.txt', 'requirements']) else: to_delete.append('Pipfile') if (use...
def test_online_tokenizer_config(self): "this just tests that the online tokenizer files get correctly fetched and\n loaded via its tokenizer_config.json and it's not slow so it's run by normal CI\n " tokenizer = FSMTTokenizer.from_pretrained(FSMT_TINY2) self.assertListEqual([tokenizer.src_lan...
-580,064,580,574,381,400
this just tests that the online tokenizer files get correctly fetched and loaded via its tokenizer_config.json and it's not slow so it's run by normal CI
tests/test_tokenization_fsmt.py
test_online_tokenizer_config
DATEXIS/adapter-transformers
python
def test_online_tokenizer_config(self): "this just tests that the online tokenizer files get correctly fetched and\n loaded via its tokenizer_config.json and it's not slow so it's run by normal CI\n " tokenizer = FSMTTokenizer.from_pretrained(FSMT_TINY2) self.assertListEqual([tokenizer.src_lan...
def test_full_tokenizer(self): ' Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt ' tokenizer = FSMTTokenizer(self.langs, self.src_vocab_file, self.tgt_vocab_file, self.merges_file) text = 'lower' bpe_tokens = ['low', 'er</w>'] tokens = tokenizer.tokenize(text) self...
3,234,412,184,335,168,500
Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt
tests/test_tokenization_fsmt.py
test_full_tokenizer
DATEXIS/adapter-transformers
python
def test_full_tokenizer(self): ' ' tokenizer = FSMTTokenizer(self.langs, self.src_vocab_file, self.tgt_vocab_file, self.merges_file) text = 'lower' bpe_tokens = ['low', 'er</w>'] tokens = tokenizer.tokenize(text) self.assertListEqual(tokens, bpe_tokens) input_tokens = (tokens + ['<unk>']) ...
def fit(self, xi_train, xv_train, y_train, xi_valid=None, xv_valid=None, y_valid=None, early_stopping=False, refit=False): '\n :param xi_train: [[ind1_1, ind1_2, ...], ..., [indi_1, indi_2, ..., indi_j, ...], ...]\n indi_j is the feature index of feature field j of sample i in the tra...
-999,047,470,642,253,700
:param xi_train: [[ind1_1, ind1_2, ...], ..., [indi_1, indi_2, ..., indi_j, ...], ...] indi_j is the feature index of feature field j of sample i in the training set :param xv_train: [[val1_1, val1_2, ...], ..., [vali_1, vali_2, ..., vali_j, ...], ...] vali_j is the feature value of fe...
tutorials/chapter_05_ProductNN/ProductNN.py
fit
Daniel1586/Initiative_RecSys
python
def fit(self, xi_train, xv_train, y_train, xi_valid=None, xv_valid=None, y_valid=None, early_stopping=False, refit=False): '\n :param xi_train: [[ind1_1, ind1_2, ...], ..., [indi_1, indi_2, ..., indi_j, ...], ...]\n indi_j is the feature index of feature field j of sample i in the tra...
def list_buckets(client=s3_client): '\n Usage: [arg1]:[initialized s3 client object],\n Description: Gets the list of buckets\n Returns: [list of buckets]\n ' response = s3_client.list_buckets() buckets = [] for bucket in response['Buckets']: buckets.append(bucket['Name']) return...
-6,498,878,433,956,038,000
Usage: [arg1]:[initialized s3 client object], Description: Gets the list of buckets Returns: [list of buckets]
ctrl4bi/aws_connect.py
list_buckets
vkreat-tech/ctrl4bi
python
def list_buckets(client=s3_client): '\n Usage: [arg1]:[initialized s3 client object],\n Description: Gets the list of buckets\n Returns: [list of buckets]\n ' response = s3_client.list_buckets() buckets = [] for bucket in response['Buckets']: buckets.append(bucket['Name']) return...
def list_objects(bucket, prefix='', client=s3_client): '\n Usage: [arg1]:[bucket name],[arg2]:[pattern to match keys in s3],[arg3]:[initialized s3 client object],\n Description: Gets the keys in the S3 location\n Returns: [list of keys], [list of directories]\n ' keys = [] dirs = set() next_...
-8,144,335,608,066,176,000
Usage: [arg1]:[bucket name],[arg2]:[pattern to match keys in s3],[arg3]:[initialized s3 client object], Description: Gets the keys in the S3 location Returns: [list of keys], [list of directories]
ctrl4bi/aws_connect.py
list_objects
vkreat-tech/ctrl4bi
python
def list_objects(bucket, prefix=, client=s3_client): '\n Usage: [arg1]:[bucket name],[arg2]:[pattern to match keys in s3],[arg3]:[initialized s3 client object],\n Description: Gets the keys in the S3 location\n Returns: [list of keys], [list of directories]\n ' keys = [] dirs = set() next_to...
def download_dir(bucket, prefix, local_path, client=s3_client): '\n Usage: [arg1]:[bucket name],[arg2]:[pattern to match keys in s3],[arg3]:[local path to folder in which to place files],[arg4]:[initialized s3 client object],\n Description: Downloads the contents to the local path\n ' keys = [] dir...
5,385,448,467,571,741,000
Usage: [arg1]:[bucket name],[arg2]:[pattern to match keys in s3],[arg3]:[local path to folder in which to place files],[arg4]:[initialized s3 client object], Description: Downloads the contents to the local path
ctrl4bi/aws_connect.py
download_dir
vkreat-tech/ctrl4bi
python
def download_dir(bucket, prefix, local_path, client=s3_client): '\n Usage: [arg1]:[bucket name],[arg2]:[pattern to match keys in s3],[arg3]:[local path to folder in which to place files],[arg4]:[initialized s3 client object],\n Description: Downloads the contents to the local path\n ' keys = [] dir...
def __init__(self, name=None, channels=None, dependencies=None, local_vars_configuration=None): 'KernelSpec - a model defined in OpenAPI' if (local_vars_configuration is None): local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration self._name = None ...
4,647,245,784,887,724,000
KernelSpec - a model defined in OpenAPI
submarine-sdk/pysubmarine/submarine/experiment/models/kernel_spec.py
__init__
KUAN-HSUN-LI/submarine
python
def __init__(self, name=None, channels=None, dependencies=None, local_vars_configuration=None): if (local_vars_configuration is None): local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration self._name = None self._channels = None self._depend...
@property def name(self): 'Gets the name of this KernelSpec. # noqa: E501\n\n\n :return: The name of this KernelSpec. # noqa: E501\n :rtype: str\n ' return self._name
2,942,202,076,586,926,000
Gets the name of this KernelSpec. # noqa: E501 :return: The name of this KernelSpec. # noqa: E501 :rtype: str
submarine-sdk/pysubmarine/submarine/experiment/models/kernel_spec.py
name
KUAN-HSUN-LI/submarine
python
@property def name(self): 'Gets the name of this KernelSpec. # noqa: E501\n\n\n :return: The name of this KernelSpec. # noqa: E501\n :rtype: str\n ' return self._name
@name.setter def name(self, name): 'Sets the name of this KernelSpec.\n\n\n :param name: The name of this KernelSpec. # noqa: E501\n :type: str\n ' self._name = name
2,682,577,613,443,766,300
Sets the name of this KernelSpec. :param name: The name of this KernelSpec. # noqa: E501 :type: str
submarine-sdk/pysubmarine/submarine/experiment/models/kernel_spec.py
name
KUAN-HSUN-LI/submarine
python
@name.setter def name(self, name): 'Sets the name of this KernelSpec.\n\n\n :param name: The name of this KernelSpec. # noqa: E501\n :type: str\n ' self._name = name
@property def channels(self): 'Gets the channels of this KernelSpec. # noqa: E501\n\n\n :return: The channels of this KernelSpec. # noqa: E501\n :rtype: list[str]\n ' return self._channels
-3,157,689,001,019,074,000
Gets the channels of this KernelSpec. # noqa: E501 :return: The channels of this KernelSpec. # noqa: E501 :rtype: list[str]
submarine-sdk/pysubmarine/submarine/experiment/models/kernel_spec.py
channels
KUAN-HSUN-LI/submarine
python
@property def channels(self): 'Gets the channels of this KernelSpec. # noqa: E501\n\n\n :return: The channels of this KernelSpec. # noqa: E501\n :rtype: list[str]\n ' return self._channels
@channels.setter def channels(self, channels): 'Sets the channels of this KernelSpec.\n\n\n :param channels: The channels of this KernelSpec. # noqa: E501\n :type: list[str]\n ' self._channels = channels
2,079,475,509,252,598,300
Sets the channels of this KernelSpec. :param channels: The channels of this KernelSpec. # noqa: E501 :type: list[str]
submarine-sdk/pysubmarine/submarine/experiment/models/kernel_spec.py
channels
KUAN-HSUN-LI/submarine
python
@channels.setter def channels(self, channels): 'Sets the channels of this KernelSpec.\n\n\n :param channels: The channels of this KernelSpec. # noqa: E501\n :type: list[str]\n ' self._channels = channels
@property def dependencies(self): 'Gets the dependencies of this KernelSpec. # noqa: E501\n\n\n :return: The dependencies of this KernelSpec. # noqa: E501\n :rtype: list[str]\n ' return self._dependencies
-8,961,836,283,899,798,000
Gets the dependencies of this KernelSpec. # noqa: E501 :return: The dependencies of this KernelSpec. # noqa: E501 :rtype: list[str]
submarine-sdk/pysubmarine/submarine/experiment/models/kernel_spec.py
dependencies
KUAN-HSUN-LI/submarine
python
@property def dependencies(self): 'Gets the dependencies of this KernelSpec. # noqa: E501\n\n\n :return: The dependencies of this KernelSpec. # noqa: E501\n :rtype: list[str]\n ' return self._dependencies
@dependencies.setter def dependencies(self, dependencies): 'Sets the dependencies of this KernelSpec.\n\n\n :param dependencies: The dependencies of this KernelSpec. # noqa: E501\n :type: list[str]\n ' self._dependencies = dependencies
2,991,228,109,283,427,300
Sets the dependencies of this KernelSpec. :param dependencies: The dependencies of this KernelSpec. # noqa: E501 :type: list[str]
submarine-sdk/pysubmarine/submarine/experiment/models/kernel_spec.py
dependencies
KUAN-HSUN-LI/submarine
python
@dependencies.setter def dependencies(self, dependencies): 'Sets the dependencies of this KernelSpec.\n\n\n :param dependencies: The dependencies of this KernelSpec. # noqa: E501\n :type: list[str]\n ' self._dependencies = dependencies
def to_dict(self): 'Returns the model properties as a dict' result = {} for (attr, _) in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value)) e...
8,442,519,487,048,767,000
Returns the model properties as a dict
submarine-sdk/pysubmarine/submarine/experiment/models/kernel_spec.py
to_dict
KUAN-HSUN-LI/submarine
python
def to_dict(self): result = {} for (attr, _) in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value)) elif hasattr(value, 'to_dict'): ...
def to_str(self): 'Returns the string representation of the model' return pprint.pformat(self.to_dict())
5,849,158,643,760,736,000
Returns the string representation of the model
submarine-sdk/pysubmarine/submarine/experiment/models/kernel_spec.py
to_str
KUAN-HSUN-LI/submarine
python
def to_str(self): return pprint.pformat(self.to_dict())
def __repr__(self): 'For `print` and `pprint`' return self.to_str()
-8,960,031,694,814,905,000
For `print` and `pprint`
submarine-sdk/pysubmarine/submarine/experiment/models/kernel_spec.py
__repr__
KUAN-HSUN-LI/submarine
python
def __repr__(self): return self.to_str()
def __eq__(self, other): 'Returns true if both objects are equal' if (not isinstance(other, KernelSpec)): return False return (self.to_dict() == other.to_dict())
-7,715,880,987,173,101,000
Returns true if both objects are equal
submarine-sdk/pysubmarine/submarine/experiment/models/kernel_spec.py
__eq__
KUAN-HSUN-LI/submarine
python
def __eq__(self, other): if (not isinstance(other, KernelSpec)): return False return (self.to_dict() == other.to_dict())
def __ne__(self, other): 'Returns true if both objects are not equal' if (not isinstance(other, KernelSpec)): return True return (self.to_dict() != other.to_dict())
-3,783,474,172,759,675,000
Returns true if both objects are not equal
submarine-sdk/pysubmarine/submarine/experiment/models/kernel_spec.py
__ne__
KUAN-HSUN-LI/submarine
python
def __ne__(self, other): if (not isinstance(other, KernelSpec)): return True return (self.to_dict() != other.to_dict())
def run_bind_test(self, allow_ips, connect_to, addresses, expected): '\n Start a node with requested rpcallowip and rpcbind parameters,\n then try to connect, and check if the set of bound addresses\n matches the expected set.\n ' self.log.info(('Bind test for %s' % str(addresses))) ...
-6,699,779,156,219,655,000
Start a node with requested rpcallowip and rpcbind parameters, then try to connect, and check if the set of bound addresses matches the expected set.
test/functional/rpcbind_test.py
run_bind_test
CaliforniaCoinCAC/californiacoin
python
def run_bind_test(self, allow_ips, connect_to, addresses, expected): '\n Start a node with requested rpcallowip and rpcbind parameters,\n then try to connect, and check if the set of bound addresses\n matches the expected set.\n ' self.log.info(('Bind test for %s' % str(addresses))) ...
def run_allowip_test(self, allow_ips, rpchost, rpcport): '\n Start a node with rpcallow IP, and request getnetworkinfo\n at a non-localhost IP.\n ' self.log.info(('Allow IP test for %s:%d' % (rpchost, rpcport))) base_args = (['-disablewallet', '-nolisten'] + [('-rpcallowip=' + x) for x ...
-8,650,732,974,665,215,000
Start a node with rpcallow IP, and request getnetworkinfo at a non-localhost IP.
test/functional/rpcbind_test.py
run_allowip_test
CaliforniaCoinCAC/californiacoin
python
def run_allowip_test(self, allow_ips, rpchost, rpcport): '\n Start a node with rpcallow IP, and request getnetworkinfo\n at a non-localhost IP.\n ' self.log.info(('Allow IP test for %s:%d' % (rpchost, rpcport))) base_args = (['-disablewallet', '-nolisten'] + [('-rpcallowip=' + x) for x ...
def __init__(self, model_description: str, path: str=None, history=None, save_it: bool=True, new_style: bool=False): '\n The class constructor. \n Attention: File history plotting is not yet implemented!\n :param model_description:str: something to name the image unique and is also the file...
3,218,054,712,274,708,500
The class constructor. Attention: File history plotting is not yet implemented! :param model_description:str: something to name the image unique and is also the file name :param path:str: path of a file containing a history :param history: a history :param save_it:bool: save the plot instead of showing...
Scripts/Plotter/PlotHistory.py
__init__
ReleasedBrainiac/GraphToSequenceNN
python
def __init__(self, model_description: str, path: str=None, history=None, save_it: bool=True, new_style: bool=False): '\n The class constructor. \n Attention: File history plotting is not yet implemented!\n :param model_description:str: something to name the image unique and is also the file...
def PlotHistory(self): '\n Thise method allow to plot a history from directly a keras history. \n Plotting from log is not yet implemented!\n ' try: if self._using_history: if self._new_style: self.CollectFromHistory() self.DirectPlotHist...
-9,081,983,840,649,278,000
Thise method allow to plot a history from directly a keras history. Plotting from log is not yet implemented!
Scripts/Plotter/PlotHistory.py
PlotHistory
ReleasedBrainiac/GraphToSequenceNN
python
def PlotHistory(self): '\n Thise method allow to plot a history from directly a keras history. \n Plotting from log is not yet implemented!\n ' try: if self._using_history: if self._new_style: self.CollectFromHistory() self.DirectPlotHist...
def CollectAccFromHistory(self, name: str): '\n This method collect the accuracy data from the history into 2 lists.\n :param name:str: name of the used acc metric\n ' try: acc_list: list = [] val_acc_list: list = [] name = re.sub('val_', '', name) if (n...
-6,079,083,855,885,626,000
This method collect the accuracy data from the history into 2 lists. :param name:str: name of the used acc metric
Scripts/Plotter/PlotHistory.py
CollectAccFromHistory
ReleasedBrainiac/GraphToSequenceNN
python
def CollectAccFromHistory(self, name: str): '\n This method collect the accuracy data from the history into 2 lists.\n :param name:str: name of the used acc metric\n ' try: acc_list: list = [] val_acc_list: list = [] name = re.sub('val_', , name) if (nam...
def CollectLossFromHistory(self): '\n This method collect the loss metric data from the history.\n ' try: loss_val: str = 'loss' if (loss_val in self._history_keys): self._losses = [s for s in self._history_keys if (loss_val == s)] self._val_losses = [s for ...
-2,332,289,488,565,356,000
This method collect the loss metric data from the history.
Scripts/Plotter/PlotHistory.py
CollectLossFromHistory
ReleasedBrainiac/GraphToSequenceNN
python
def CollectLossFromHistory(self): '\n \n ' try: loss_val: str = 'loss' if (loss_val in self._history_keys): self._losses = [s for s in self._history_keys if (loss_val == s)] self._val_losses = [s for s in self._history_keys if (('val' + loss_val) in s)] ...
def CollectLearningRatesFromHistory(self): '\n This method collect the learning rate metric data from the history.\n ' try: lr_val: str = 'lr' if (lr_val in self._history_keys): self._learning_rates = [s for s in self._history_keys if (lr_val == s)] if isNot...
-4,803,077,714,445,215,000
This method collect the learning rate metric data from the history.
Scripts/Plotter/PlotHistory.py
CollectLearningRatesFromHistory
ReleasedBrainiac/GraphToSequenceNN
python
def CollectLearningRatesFromHistory(self): '\n \n ' try: lr_val: str = 'lr' if (lr_val in self._history_keys): self._learning_rates = [s for s in self._history_keys if (lr_val == s)] if isNotNone(self._learning_rates): self._history_keys_list...
def CollectFromHistory(self): '\n This method collect all necessary train informations from the history.\n ' if self._using_history: try: print('Collect losses from history...') self.CollectLossFromHistory() print('Collect learning rate from history...')...
-5,342,395,841,408,103,000
This method collect all necessary train informations from the history.
Scripts/Plotter/PlotHistory.py
CollectFromHistory
ReleasedBrainiac/GraphToSequenceNN
python
def CollectFromHistory(self): '\n \n ' if self._using_history: try: print('Collect losses from history...') self.CollectLossFromHistory() print('Collect learning rate from history...') self.CollectLearningRatesFromHistory() print(...
def DirectPlotHistory(self): '\n This method helps to plot a keras history containing losses, accuracy and possibly least learning rates.\n ' try: fig_num: int = 1 self.AccOrLossPlot(fig_num=fig_num, title='Model loss', metric='loss', axis_labels=['train', 'validation'], history_la...
7,061,467,197,599,251,000
This method helps to plot a keras history containing losses, accuracy and possibly least learning rates.
Scripts/Plotter/PlotHistory.py
DirectPlotHistory
ReleasedBrainiac/GraphToSequenceNN
python
def DirectPlotHistory(self): '\n \n ' try: fig_num: int = 1 self.AccOrLossPlot(fig_num=fig_num, title='Model loss', metric='loss', axis_labels=['train', 'validation'], history_labels=['Loss', 'Epoch'], extender='loss_epoch_plot', train_val_lists=[self._losses, self._val_losses]) ...
def OldPlotHistory(self): '\n This method plot the history in the old way.\n ' try: fig_num: int = 1 self.AccOrLossPlot(fig_num=fig_num, title='Model loss', metric='loss', axis_labels=['train', 'validation'], history_labels=['Loss', 'Epoch'], extender='loss_epoch_plot') fig...
7,242,522,773,362,320,000
This method plot the history in the old way.
Scripts/Plotter/PlotHistory.py
OldPlotHistory
ReleasedBrainiac/GraphToSequenceNN
python
def OldPlotHistory(self): '\n \n ' try: fig_num: int = 1 self.AccOrLossPlot(fig_num=fig_num, title='Model loss', metric='loss', axis_labels=['train', 'validation'], history_labels=['Loss', 'Epoch'], extender='loss_epoch_plot') fig_num += 1 if ('acc' in self._history...
def AccOrLossPlot(self, fig_num: int, title: str, metric: str, axis_labels: list=['train', 'validation'], history_labels: list=['Metric', 'Epoch'], extender: str='_epoch_plot', train_val_lists: list=None): '\n This method wrapp the plot creation for a single metric of the keras train history.\n :p...
-994,659,522,012,894,500
This method wrapp the plot creation for a single metric of the keras train history. :param fig_num:int: figure number :param title:str: figure title :param metric:str: desired metric :param axis_labels:list: axis labels :param history_labels:list: history labels :param extender:str: plot file n...
Scripts/Plotter/PlotHistory.py
AccOrLossPlot
ReleasedBrainiac/GraphToSequenceNN
python
def AccOrLossPlot(self, fig_num: int, title: str, metric: str, axis_labels: list=['train', 'validation'], history_labels: list=['Metric', 'Epoch'], extender: str='_epoch_plot', train_val_lists: list=None): '\n This method wrapp the plot creation for a single metric of the keras train history.\n :p...
def LearningPlot(self, fig_num: int, title: str='Model Learning Rate', metric: str='lr', axis_labels: list=['train', 'validation'], history_labels: list=['Learning Rate', 'Epoch'], extender: str='learning_rate_epoch_plot'): '\n This method plot a the single learning rate curve.\n :param fig_num:in...
8,425,297,315,928,478,000
This method plot a the single learning rate curve. :param fig_num:int: figure number :param title:str: figure title :param metric:str: desired metric :param axis_labels:list: axis labels :param history_labels:list: history labels :param extender:str: plot file name extender
Scripts/Plotter/PlotHistory.py
LearningPlot
ReleasedBrainiac/GraphToSequenceNN
python
def LearningPlot(self, fig_num: int, title: str='Model Learning Rate', metric: str='lr', axis_labels: list=['train', 'validation'], history_labels: list=['Learning Rate', 'Epoch'], extender: str='learning_rate_epoch_plot'): '\n This method plot a the single learning rate curve.\n :param fig_num:in...
def CalcResultAccuracy(self, history, metric: str='acc'): '\n This method show the train acc results.\n :param history: history of the training\n ' try: return ('Training accuracy: %.2f%% / Validation accuracy: %.2f%%' % ((100 * history.history[metric][(- 1)]), (100 * history.hi...
-3,302,066,514,028,731,000
This method show the train acc results. :param history: history of the training
Scripts/Plotter/PlotHistory.py
CalcResultAccuracy
ReleasedBrainiac/GraphToSequenceNN
python
def CalcResultAccuracy(self, history, metric: str='acc'): '\n This method show the train acc results.\n :param history: history of the training\n ' try: return ('Training accuracy: %.2f%% / Validation accuracy: %.2f%%' % ((100 * history.history[metric][(- 1)]), (100 * history.hi...
def CalcResultLoss(self, history): '\n This method show the train loss results.\n :param history: history of the training\n ' try: return ((('Training loss: ' + str(history.history['loss'][(- 1)])[:(- 6)]) + ' / Validation loss: ') + str(history.history['val_loss'][(- 1)])[:(- 6...
-9,213,006,050,517,600,000
This method show the train loss results. :param history: history of the training
Scripts/Plotter/PlotHistory.py
CalcResultLoss
ReleasedBrainiac/GraphToSequenceNN
python
def CalcResultLoss(self, history): '\n This method show the train loss results.\n :param history: history of the training\n ' try: return ((('Training loss: ' + str(history.history['loss'][(- 1)])[:(- 6)]) + ' / Validation loss: ') + str(history.history['val_loss'][(- 1)])[:(- 6...
def CalcResultLearnRate(self, history): '\n This method show the train learn rate.\n :param history: history of the training\n ' try: return ('Training Learn Rate: ' + str(history.history['lr'][(- 1)])) except Exception as ex: template = 'An exception of type {0} occ...
2,398,961,352,070,724,000
This method show the train learn rate. :param history: history of the training
Scripts/Plotter/PlotHistory.py
CalcResultLearnRate
ReleasedBrainiac/GraphToSequenceNN
python
def CalcResultLearnRate(self, history): '\n This method show the train learn rate.\n :param history: history of the training\n ' try: return ('Training Learn Rate: ' + str(history.history['lr'][(- 1)])) except Exception as ex: template = 'An exception of type {0} occ...
@staticmethod def add_prefix(label_words, prefix): "Add prefix to label words. For example, if a label words is in the middle of a template,\n the prefix should be ``' '``.\n\n Args:\n label_words (:obj:`Union[Sequence[str], Mapping[str, str]]`, optional): The label words that are projected...
3,213,134,003,616,306,700
Add prefix to label words. For example, if a label words is in the middle of a template, the prefix should be ``' '``. Args: label_words (:obj:`Union[Sequence[str], Mapping[str, str]]`, optional): The label words that are projected by the labels. prefix (:obj:`str`, optional): The prefix string of the verbaliz...
openprompt/prompts/one2one_verbalizer.py
add_prefix
BIT-ENGD/OpenPrompt
python
@staticmethod def add_prefix(label_words, prefix): "Add prefix to label words. For example, if a label words is in the middle of a template,\n the prefix should be ``' '``.\n\n Args:\n label_words (:obj:`Union[Sequence[str], Mapping[str, str]]`, optional): The label words that are projected...
def generate_parameters(self) -> List: 'In basic manual template, the parameters are generated from label words directly.\n In this implementation, the label_words should not be tokenized into more than one token.\n ' words_ids = [] for word in self.label_words: word_ids = self.tokeniz...
1,266,850,082,361,135,000
In basic manual template, the parameters are generated from label words directly. In this implementation, the label_words should not be tokenized into more than one token.
openprompt/prompts/one2one_verbalizer.py
generate_parameters
BIT-ENGD/OpenPrompt
python
def generate_parameters(self) -> List: 'In basic manual template, the parameters are generated from label words directly.\n In this implementation, the label_words should not be tokenized into more than one token.\n ' words_ids = [] for word in self.label_words: word_ids = self.tokeniz...
def project(self, logits: torch.Tensor, **kwargs) -> torch.Tensor: '\n Project the labels, the return value is the normalized (sum to 1) probs of label words.\n\n Args:\n logits (:obj:`torch.Tensor`): The orginal logits of label words.\n\n Returns:\n :obj:`torch.Tensor`: T...
364,629,113,235,906,700
Project the labels, the return value is the normalized (sum to 1) probs of label words. Args: logits (:obj:`torch.Tensor`): The orginal logits of label words. Returns: :obj:`torch.Tensor`: The normalized logits of label words
openprompt/prompts/one2one_verbalizer.py
project
BIT-ENGD/OpenPrompt
python
def project(self, logits: torch.Tensor, **kwargs) -> torch.Tensor: '\n Project the labels, the return value is the normalized (sum to 1) probs of label words.\n\n Args:\n logits (:obj:`torch.Tensor`): The orginal logits of label words.\n\n Returns:\n :obj:`torch.Tensor`: T...
def process_logits(self, logits: torch.Tensor, **kwargs): 'A whole framework to process the original logits over the vocabulary, which contains four steps:\n\n (1) Project the logits into logits of label words\n\n if self.post_log_softmax is True:\n\n (2) Normalize over all label words\n\n ...
1,527,449,169,758,929,200
A whole framework to process the original logits over the vocabulary, which contains four steps: (1) Project the logits into logits of label words if self.post_log_softmax is True: (2) Normalize over all label words (3) Calibrate (optional) Args: logits (:obj:`torch.Tensor`): The orginal logits. Retur...
openprompt/prompts/one2one_verbalizer.py
process_logits
BIT-ENGD/OpenPrompt
python
def process_logits(self, logits: torch.Tensor, **kwargs): 'A whole framework to process the original logits over the vocabulary, which contains four steps:\n\n (1) Project the logits into logits of label words\n\n if self.post_log_softmax is True:\n\n (2) Normalize over all label words\n\n ...
def normalize(self, logits: torch.Tensor) -> torch.Tensor: '\n Given logits regarding the entire vocabulary, return the probs over the label words set.\n\n Args:\n logits (:obj:`Tensor`): The logits over the entire vocabulary.\n\n Returns:\n :obj:`Tensor`: The logits over ...
-2,564,412,923,553,433,000
Given logits regarding the entire vocabulary, return the probs over the label words set. Args: logits (:obj:`Tensor`): The logits over the entire vocabulary. Returns: :obj:`Tensor`: The logits over the label words set.
openprompt/prompts/one2one_verbalizer.py
normalize
BIT-ENGD/OpenPrompt
python
def normalize(self, logits: torch.Tensor) -> torch.Tensor: '\n Given logits regarding the entire vocabulary, return the probs over the label words set.\n\n Args:\n logits (:obj:`Tensor`): The logits over the entire vocabulary.\n\n Returns:\n :obj:`Tensor`: The logits over ...
def calibrate(self, label_words_probs: torch.Tensor, **kwargs) -> torch.Tensor: '\n\n Args:\n label_words_probs (:obj:`torch.Tensor`): The probability distribution of the label words with the shape of [``batch_size``, ``num_classes``, ``num_label_words_per_class``]\n\n Returns:\n ...
5,181,480,780,885,066,000
Args: label_words_probs (:obj:`torch.Tensor`): The probability distribution of the label words with the shape of [``batch_size``, ``num_classes``, ``num_label_words_per_class``] Returns: :obj:`torch.Tensor`: The calibrated probability of label words.
openprompt/prompts/one2one_verbalizer.py
calibrate
BIT-ENGD/OpenPrompt
python
def calibrate(self, label_words_probs: torch.Tensor, **kwargs) -> torch.Tensor: '\n\n Args:\n label_words_probs (:obj:`torch.Tensor`): The probability distribution of the label words with the shape of [``batch_size``, ``num_classes``, ``num_label_words_per_class``]\n\n Returns:\n ...
def timeline_trimmed_to_range(in_timeline, trim_range): "Returns a new timeline that is a copy of the in_timeline, but with items\n outside the trim_range removed and items on the ends trimmed to the\n trim_range. Note that the timeline is never expanded, only shortened.\n Please note that you could do nea...
-1,156,443,789,120,338,000
Returns a new timeline that is a copy of the in_timeline, but with items outside the trim_range removed and items on the ends trimmed to the trim_range. Note that the timeline is never expanded, only shortened. Please note that you could do nearly the same thing non-destructively by just setting the Track's source_rang...
src/py-opentimelineio/opentimelineio/algorithms/timeline_algo.py
timeline_trimmed_to_range
AWhetter/OpenTimelineIO
python
def timeline_trimmed_to_range(in_timeline, trim_range): "Returns a new timeline that is a copy of the in_timeline, but with items\n outside the trim_range removed and items on the ends trimmed to the\n trim_range. Note that the timeline is never expanded, only shortened.\n Please note that you could do nea...
@verbose def plot_cov(cov, info, exclude=(), colorbar=True, proj=False, show_svd=True, show=True, verbose=None): "Plot Covariance data.\n\n Parameters\n ----------\n cov : instance of Covariance\n The covariance matrix.\n info : dict\n Measurement info.\n exclude : list of str | str\n ...
-5,992,722,798,221,997,000
Plot Covariance data. Parameters ---------- cov : instance of Covariance The covariance matrix. info : dict Measurement info. exclude : list of str | str List of channels to exclude. If empty do not exclude any channel. If 'bads', exclude info['bads']. colorbar : bool Show colorbar or not. proj : b...
mne/viz/misc.py
plot_cov
Aniket-Pradhan/mne-python
python
@verbose def plot_cov(cov, info, exclude=(), colorbar=True, proj=False, show_svd=True, show=True, verbose=None): "Plot Covariance data.\n\n Parameters\n ----------\n cov : instance of Covariance\n The covariance matrix.\n info : dict\n Measurement info.\n exclude : list of str | str\n ...
def plot_source_spectrogram(stcs, freq_bins, tmin=None, tmax=None, source_index=None, colorbar=False, show=True): 'Plot source power in time-freqency grid.\n\n Parameters\n ----------\n stcs : list of SourceEstimate\n Source power for consecutive time windows, one SourceEstimate object\n shou...
-2,642,318,892,408,412,700
Plot source power in time-freqency grid. Parameters ---------- stcs : list of SourceEstimate Source power for consecutive time windows, one SourceEstimate object should be provided for each frequency bin. freq_bins : list of tuples of float Start and end points of frequency bins of interest. tmin : float ...
mne/viz/misc.py
plot_source_spectrogram
Aniket-Pradhan/mne-python
python
def plot_source_spectrogram(stcs, freq_bins, tmin=None, tmax=None, source_index=None, colorbar=False, show=True): 'Plot source power in time-freqency grid.\n\n Parameters\n ----------\n stcs : list of SourceEstimate\n Source power for consecutive time windows, one SourceEstimate object\n shou...
def _plot_mri_contours(mri_fname, surfaces, src, orientation='coronal', slices=None, show=True, show_indices=False, show_orientation=False, img_output=False): 'Plot BEM contours on anatomical slices.' import matplotlib.pyplot as plt from matplotlib import patheffects _check_option('orientation', orienta...
-5,006,268,207,408,695,000
Plot BEM contours on anatomical slices.
mne/viz/misc.py
_plot_mri_contours
Aniket-Pradhan/mne-python
python
def _plot_mri_contours(mri_fname, surfaces, src, orientation='coronal', slices=None, show=True, show_indices=False, show_orientation=False, img_output=False): import matplotlib.pyplot as plt from matplotlib import patheffects _check_option('orientation', orientation, ('coronal', 'axial', 'sagittal')) ...
def plot_bem(subject=None, subjects_dir=None, orientation='coronal', slices=None, brain_surfaces=None, src=None, show=True, show_indices=True, mri='T1.mgz', show_orientation=True): 'Plot BEM contours on anatomical slices.\n\n Parameters\n ----------\n subject : str\n Subject name.\n subjects_dir ...
8,103,669,124,879,086,000
Plot BEM contours on anatomical slices. Parameters ---------- subject : str Subject name. subjects_dir : str | None Path to the SUBJECTS_DIR. If None, the path is obtained by using the environment variable SUBJECTS_DIR. orientation : str 'coronal' or 'axial' or 'sagittal'. slices : list of int Slic...
mne/viz/misc.py
plot_bem
Aniket-Pradhan/mne-python
python
def plot_bem(subject=None, subjects_dir=None, orientation='coronal', slices=None, brain_surfaces=None, src=None, show=True, show_indices=True, mri='T1.mgz', show_orientation=True): 'Plot BEM contours on anatomical slices.\n\n Parameters\n ----------\n subject : str\n Subject name.\n subjects_dir ...
@verbose def plot_events(events, sfreq=None, first_samp=0, color=None, event_id=None, axes=None, equal_spacing=True, show=True, on_missing='raise', verbose=None): "Plot events to get a visual display of the paradigm.\n\n Parameters\n ----------\n events : array, shape (n_events, 3)\n The events.\n ...
1,551,174,879,459,412,200
Plot events to get a visual display of the paradigm. Parameters ---------- events : array, shape (n_events, 3) The events. sfreq : float | None The sample frequency. If None, data will be displayed in samples (not seconds). first_samp : int The index of the first sample. Recordings made on Neuromag sys...
mne/viz/misc.py
plot_events
Aniket-Pradhan/mne-python
python
@verbose def plot_events(events, sfreq=None, first_samp=0, color=None, event_id=None, axes=None, equal_spacing=True, show=True, on_missing='raise', verbose=None): "Plot events to get a visual display of the paradigm.\n\n Parameters\n ----------\n events : array, shape (n_events, 3)\n The events.\n ...
def _get_presser(fig): 'Get our press callback.' import matplotlib callbacks = fig.canvas.callbacks.callbacks['button_press_event'] func = None for (key, val) in callbacks.items(): if (LooseVersion(matplotlib.__version__) >= '3'): func = val() else: func = val...
-2,291,499,084,552,287,000
Get our press callback.
mne/viz/misc.py
_get_presser
Aniket-Pradhan/mne-python
python
def _get_presser(fig): import matplotlib callbacks = fig.canvas.callbacks.callbacks['button_press_event'] func = None for (key, val) in callbacks.items(): if (LooseVersion(matplotlib.__version__) >= '3'): func = val() else: func = val.func if (func.__...
def plot_dipole_amplitudes(dipoles, colors=None, show=True): 'Plot the amplitude traces of a set of dipoles.\n\n Parameters\n ----------\n dipoles : list of instance of Dipole\n The dipoles whose amplitudes should be shown.\n colors : list of color | None\n Color to plot with each dipole. ...
4,548,696,912,232,993,000
Plot the amplitude traces of a set of dipoles. Parameters ---------- dipoles : list of instance of Dipole The dipoles whose amplitudes should be shown. colors : list of color | None Color to plot with each dipole. If None default colors are used. show : bool Show figure if True. Returns ------- fig : matp...
mne/viz/misc.py
plot_dipole_amplitudes
Aniket-Pradhan/mne-python
python
def plot_dipole_amplitudes(dipoles, colors=None, show=True): 'Plot the amplitude traces of a set of dipoles.\n\n Parameters\n ----------\n dipoles : list of instance of Dipole\n The dipoles whose amplitudes should be shown.\n colors : list of color | None\n Color to plot with each dipole. ...
def adjust_axes(axes, remove_spines=('top', 'right'), grid=True): 'Adjust some properties of axes.\n\n Parameters\n ----------\n axes : list\n List of axes to process.\n remove_spines : list of str\n Which axis spines to remove.\n grid : bool\n Turn grid on (True) or off (False)....
4,676,078,817,384,858,000
Adjust some properties of axes. Parameters ---------- axes : list List of axes to process. remove_spines : list of str Which axis spines to remove. grid : bool Turn grid on (True) or off (False).
mne/viz/misc.py
adjust_axes
Aniket-Pradhan/mne-python
python
def adjust_axes(axes, remove_spines=('top', 'right'), grid=True): 'Adjust some properties of axes.\n\n Parameters\n ----------\n axes : list\n List of axes to process.\n remove_spines : list of str\n Which axis spines to remove.\n grid : bool\n Turn grid on (True) or off (False)....
def _filter_ticks(lims, fscale): 'Create approximately spaced ticks between lims.' if (fscale == 'linear'): return (None, None) lims = np.array(lims) ticks = list() if (lims[1] > (20 * lims[0])): base = np.array([1, 2, 4]) else: base = np.arange(1, 11) for exp in rang...
6,549,562,070,031,120,000
Create approximately spaced ticks between lims.
mne/viz/misc.py
_filter_ticks
Aniket-Pradhan/mne-python
python
def _filter_ticks(lims, fscale): if (fscale == 'linear'): return (None, None) lims = np.array(lims) ticks = list() if (lims[1] > (20 * lims[0])): base = np.array([1, 2, 4]) else: base = np.arange(1, 11) for exp in range(int(np.floor(np.log10(lims[0]))), (int(np.floor...
def _get_flim(flim, fscale, freq, sfreq=None): 'Get reasonable frequency limits.' if (flim is None): if (freq is None): flim = [(0.1 if (fscale == 'log') else 0.0), (sfreq / 2.0)] else: if (fscale == 'linear'): flim = [freq[0]] else: ...
2,384,666,132,643,033,000
Get reasonable frequency limits.
mne/viz/misc.py
_get_flim
Aniket-Pradhan/mne-python
python
def _get_flim(flim, fscale, freq, sfreq=None): if (flim is None): if (freq is None): flim = [(0.1 if (fscale == 'log') else 0.0), (sfreq / 2.0)] else: if (fscale == 'linear'): flim = [freq[0]] else: flim = [(freq[0] if (freq[0]...
def _check_fscale(fscale): 'Check for valid fscale.' if ((not isinstance(fscale, str)) or (fscale not in ('log', 'linear'))): raise ValueError(('fscale must be "log" or "linear", got %s' % (fscale,)))
-175,384,852,521,488,900
Check for valid fscale.
mne/viz/misc.py
_check_fscale
Aniket-Pradhan/mne-python
python
def _check_fscale(fscale): if ((not isinstance(fscale, str)) or (fscale not in ('log', 'linear'))): raise ValueError(('fscale must be "log" or "linear", got %s' % (fscale,)))