code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class network_distance_from_home_to_school(abstract_travel_time_variable): <NEW_LINE> <INDENT> agent_zone_id = "urbansim_parcel.person.zone_id" <NEW_LINE> location_zone_id = "psrc_parcel.school.zone_id" <NEW_LINE> travel_data_attribute = "urbansim.travel_data.single_vehicle_to_work_travel_distance"
single vehicle travel distance from the centroid of home zone to that of school zone
62598f71a4f1c619b294de3f
class debugger_cl (): <NEW_LINE> <INDENT> deb_msg = False <NEW_LINE> @classmethod <NEW_LINE> def c_debugging(cls): <NEW_LINE> <INDENT> cls.deb_msg = True <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def c_debug_msg(*msg): <NEW_LINE> <INDENT> if debugger_cl.deb_msg == True: <NEW_LINE> <INDENT> for i in msg: <NEW_LINE> <...
This takes a string as an argument that's supposed to be printed out for debugging and either prints it or does nothing, depending on whether self.debugging is set to True or False. That depends on whether --debugging is used at the commandline or not. A lot of the debug messages though are in the module itself, where ...
62598f718c3a8732951f5da2
class GHSRegularExpressionTest(TestCase): <NEW_LINE> <INDENT> fixtures = ['GHSIngredients.json'] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_ld50_re(self): <NEW_LINE> <INDENT> teststring1 = 'ATD 4(1100),ATI 2(1,v),ATO 3(100),CAR 2,EDI 2A,FL 4,SCI 2,STO-SE 3-RI' <NEW_LINE> self.asse...
In this test I will be using various test cases found in the hazard document and ensure that the regular expressions I wrote can capture the correct information.
62598f7173bcbd0ca4bc9aa0
class RidgeCV(_BaseRidgeCV, RegressorMixin): <NEW_LINE> <INDENT> pass
Ridge regression with built-in cross-validation. By default, it performs Generalized Cross-Validation, which is a form of efficient Leave-One-Out cross-validation. Parameters ---------- alphas: numpy array of shape [n_alphas] Array of alpha values to try. Small positive values of alpha improve the conditionin...
62598f714d74a7450cd58b03
class PreconditionFailedException(ServiceException): <NEW_LINE> <INDENT> http_status = httplib.PRECONDITION_FAILED
Precondition Failed exception that is mapped to a 412 response.
62598f71be8e80087fbbe8b2
class GraphOptimizer: <NEW_LINE> <INDENT> def __init__(self, parameters : Iterable[nn.Module], lr : float ) -> None: <NEW_LINE> <INDENT> self.lr : float = lr <NEW_LINE> self.optimizer = Adam(parameters, lr=lr) <NEW_LINE> <DEDENT> def step(self, X : Union[np.ndarray, T.tensor], X_HAT : Union[np.ndarray, T.tensor], ma...
Implements optimization and loss for GraphConvolution operation.
62598f710a366e3fb87dc21b
class CreateUDTSTaskParamSourceMySQLNodeSchema(schema.RequestSchema): <NEW_LINE> <INDENT> fields = { "DataRegion": fields.Str(required=False, dump_to="DataRegion"), "Database": fields.Str(required=False, dump_to="Database"), "DupAction": fields.Str(required=False, dump_to="DupAction"), "Host": fields.Str(required=False...
CreateUDTSTaskParamSourceMySQLNode -
62598f71d4950a0f3b110a61
class Solution: <NEW_LINE> <INDENT> def houseRobber2(self, nums): <NEW_LINE> <INDENT> if not nums: <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> if len(nums) < 2: <NEW_LINE> <INDENT> return nums[0] <NEW_LINE> <DEDENT> curr_1 = self.houseRobber(nums[:(len(nums) - 1)]) <NEW_LINE> curr_2 = self.houseRobber(nums[1:]) <N...
@param nums: An array of non-negative integers. @return: The maximum amount of money you can rob tonight
62598f7176d4e153a661c467
class Giraph(MavenPackage): <NEW_LINE> <INDENT> homepage = "https://giraph.apache.org/" <NEW_LINE> url = "https://downloads.apache.org/giraph/giraph-1.0.0/giraph-dist-1.0.0-src.tar.gz" <NEW_LINE> list_url = "https://downloads.apache.org/giraph/" <NEW_LINE> list_depth = 1 <NEW_LINE> version('1.2.0', sha256='6206f4a...
Apache Giraph is an iterative graph processing system built for high scalability.
62598f7126238365f5fac3ca
class MultiGrading(object): <NEW_LINE> <INDENT> def __init__(self, gradings): <NEW_LINE> <INDENT> assert len(gradings) > 1, 'Length of gradings should be at least 2.' <NEW_LINE> for g in gradings: <NEW_LINE> <INDENT> assert hasattr(g, 'isGrading') and g.percentage_cells and g.percentage_length, 'Invalid ...
MultiGrading. Use this object to create MultiGrading like the example below. (0.2 0.3 4) // 20% y-dir, 30% cells, expansion = 4 (0.6 0.4 1) // 60% y-dir, 40% cells, expansion = 1 (0.2 0.3 0.25) // 20% y-dir, 30% cells, expansion = 0.25 (1/4) Read more at section 5.3.1.3: http://cfd.direct/openfoam/us...
62598f710383005118f6cf57
class MethodsMixin(object): <NEW_LINE> <INDENT> def save(self): <NEW_LINE> <INDENT> db.session.add(self) <NEW_LINE> db.session.commit() <NEW_LINE> return self.id <NEW_LINE> <DEDENT> def delete(self): <NEW_LINE> <INDENT> ret = self.id <NEW_LINE> db.session.delete(self) <NEW_LINE> db.session.commit() <NEW_LINE> return re...
This class mixes in some common Class table functions like delete and save
62598f7130c21e258be98058
class Timer(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.reset() <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> self.total_time = 0 <NEW_LINE> self.calls = 0 <NEW_LINE> self.start_time = 0 <NEW_LINE> self.diff = 0 <NEW_LINE> self.average_time = 0 <NEW_LINE> <DEDENT> def tic(self):...
A simple timer.
62598f719b70327d1c57e603
class ReverseProxied(object): <NEW_LINE> <INDENT> def __init__(self, app): <NEW_LINE> <INDENT> self.app = app <NEW_LINE> <DEDENT> def __call__(self, environ, start_response): <NEW_LINE> <INDENT> script_name = environ.get('HTTP_X_SCRIPT_NAME', '') <NEW_LINE> if script_name: <NEW_LINE> <INDENT> environ['SCRIPT_NAME'] = s...
http://flask.pocoo.org/snippets/35/ Wrap the application in this middleware and configure the front-end server to add these headers, to let you quietly bind this to a URL other than / and to an HTTP scheme that is different than what is used locally. In nginx: location / { proxy_pass http://web:5001; proxy_se...
62598f718a349b6b43685a97
class VotingRecord (models.Model): <NEW_LINE> <INDENT> slug = models.SlugField(max_length=100, editable=False, null=False) <NEW_LINE> kan_id = models.IntegerField(null=True, help_text=_('kan ID')) <NEW_LINE> kan_id_chars = models.CharField(max_length=512, null=True) <NEW_LINE> scrape_date = models.DateField(null=True, ...
A voting record.
62598f71d164cc61758207cb
class Light(ToggleEntity): <NEW_LINE> <INDENT> @property <NEW_LINE> def brightness(self): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> @property <NEW_LINE> def hs_color(self): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> @property <NEW_LINE> def color_temp(self): <NEW_LINE> <INDENT> return None <NEW_LINE>...
Representation of a light.
62598f7150485f2cf55da7c5
class StatsClient(StatsClient): <NEW_LINE> <INDENT> def __init__(self, *args, **kw): <NEW_LINE> <INDENT> super(StatsClient, self).__init__(*args, **kw) <NEW_LINE> self.reset() <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> self.cache = {} <NEW_LINE> self.timings = [] <NEW_LINE> <DEDENT> def timing(self, stat,...
A client that pushes things into a local cache.
62598f71cad5886f8bdc4b77
class CourseEnrollmentAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ('id', 'course_id', 'mode', 'user', 'is_active',) <NEW_LINE> list_filter = ('mode', 'is_active',) <NEW_LINE> search_fields = ('course_id', 'mode', 'user__username',) <NEW_LINE> readonly_fields = ('course_id', 'mode', 'user',) <NEW_LINE> c...
Admin interface for the CourseEnrollment model.
62598f7115baa723494617df
class Card: <NEW_LINE> <INDENT> def __init__(self, suit, value, visible=False): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> self.suit = suit <NEW_LINE> self.visible = visible <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return str(self.value) + self.suit <NEW_LINE> <DEDENT> def __eq__(self, other):...
class object that defines a card of a Poker game.
62598f71fb3f5b602db47ddb
class singletonmethod(object): <NEW_LINE> <INDENT> def __init__(self, func): <NEW_LINE> <INDENT> self.func = func <NEW_LINE> <DEDENT> def __get__(self, obj, type=None): <NEW_LINE> <INDENT> if obj is None: <NEW_LINE> <INDENT> obj = type.singleton() <NEW_LINE> <DEDENT> if type is None: <NEW_LINE> <INDENT> type = obj.__cl...
For Declarative subclasses, this decorator will call the method on the cls.singleton() object if called as a class method (or as normal if called as an instance method).
62598f71d10714528d69d722
class card16(unittest.TestCase): <NEW_LINE> <INDENT> def testPlayable(self): <NEW_LINE> <INDENT> app = Labyrinth(1, 1, testBlankScenarioSetup) <NEW_LINE> self.assertTrue(app.deck["16"].playable("US", app)) <NEW_LINE> <DEDENT> def testEvent(self): <NEW_LINE> <INDENT> app = Labyrinth(1, 1, testBlankScenarioSetup) <NEW_LI...
Euro-Islam
62598f7115fb5d323ce7e57c
class Life(Cell2D): <NEW_LINE> <INDENT> kernel = np.ones((3,3)) <NEW_LINE> table = np.zeros(20, dtype=np.uint8) <NEW_LINE> table[[1,3,5,7,9]] = 1 <NEW_LINE> def step(self): <NEW_LINE> <INDENT> c = correlate2d(self.array, self.kernel, mode='same') <NEW_LINE> self.array = self.table[c]
Implementation of Conway's Game of Life.
62598f7273bcbd0ca4bc9aa2
class SessionMiddlewareInstance: <NEW_LINE> <INDENT> def __init__(self, scope, middleware): <NEW_LINE> <INDENT> self.middleware = middleware <NEW_LINE> self.scope = scope <NEW_LINE> if "cookies" not in self.scope: <NEW_LINE> <INDENT> raise ValueError("No cookies in scope - SessionMiddleware needs to run inside of Cooki...
Inner class that is instantiated once per scope.
62598f726e29344779affeb5
class indicesClass(object): <NEW_LINE> <INDENT> def __init__(self, ES): <NEW_LINE> <INDENT> self.ES = ES <NEW_LINE> <DEDENT> def exists(self, index): <NEW_LINE> <INDENT> return self.ES.indices.exists(index = index)
Indices helper class
62598f727b25080760ed6cf4
class DatatypeNodeStructure(NodeStructure): <NEW_LINE> <INDENT> def __init__(self, datatype_gid): <NEW_LINE> <INDENT> NodeStructure.__init__(self, datatype_gid, "") <NEW_LINE> datatype_shape = DATATYPE_SHAPE <NEW_LINE> if dao.is_datatype_group(datatype_gid): <NEW_LINE> <INDENT> datatype_shape = DATATYPE_GROUP_SHAPE <NE...
This class knows how to create a NodeStructure for a given DataType.
62598f7273bcbd0ca4bc9aa3
class CheckAPI(object): <NEW_LINE> <INDENT> args_exp = list() <NEW_LINE> keywords_exp = dict() <NEW_LINE> args = None <NEW_LINE> keywords = None <NEW_LINE> def test_num_args(self): <NEW_LINE> <INDENT> expected = len(self.args_exp) + len(self.keywords_exp) <NEW_LINE> actual = len(self.args) + len(self.keywords) <NEW_LIN...
Ensure that the API is as expected.
62598f7223e79379d538bd4d
class BaseUrlSession(requests.Session): <NEW_LINE> <INDENT> def __init__(self, base_url): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.base_url = URLObject(base_url) <NEW_LINE> <DEDENT> def request(self, method, url, data=None, headers=None, **kwargs): <NEW_LINE> <INDENT> return super().request( method=method...
A requests Session class that applies a base URL to the requested URL. This is how the flask-dance OAuth session works. This is a drop-in replacement as we move from OAuth authentication to access tokens.
62598f728e05c05ec3f6ea71
class Ondrop(HtmlTagAttribute): <NEW_LINE> <INDENT> pass
Script to be run when dragged element is being dropped
62598f720383005118f6cf5a
class RHRegistrationFormAddField(RHManageRegFormSectionBase): <NEW_LINE> <INDENT> def _process(self): <NEW_LINE> <INDENT> field_data = snakify_keys(request.json['fieldData']) <NEW_LINE> form_field = RegistrationFormField(parent_id=self.section.id, registration_form=self.regform) <NEW_LINE> _fill_form_field_with_data(fo...
Add a field to the section
62598f72287bf620b627140e
class CommonLivySession(APIView): <NEW_LINE> <INDENT> def post(self, request): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> livy_client = livy.LivyDfClientManager() <NEW_LINE> livy_client.create_session() <NEW_LINE> return_data = {"status": "200", "result": str(livy_client.alive_sess_cnt)} <NEW_LINE> return Response(js...
1. POST : 2. GET : 3. DELETE :
62598f726fece00bbaccb1e2
class Merge(object): <NEW_LINE> <INDENT> def merge(self, a, aux, lo, mid, hi): <NEW_LINE> <INDENT> assert self.isSorted(a, lo, mid) <NEW_LINE> assert self.isSorted(a, mid+1, hi) <NEW_LINE> for k in range(lo, hi + 1): <NEW_LINE> <INDENT> aux[k] = a[k] <NEW_LINE> <DEDENT> i = lo <NEW_LINE> j = mid + 1 <NEW_LINE> for k in...
Algorithm divides array into two halves, recursively sorts both halves, merges halves (Top Down). Problems - Doesn't work for short arrays - fix with cutoff
62598f72d53ae8145f917cee
class Options(Gtk.VBox, Signalizable): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> GObject.GObject.__init__(self) <NEW_LINE> Signalizable.__init__(self) <NEW_LINE> self.options = list() <NEW_LINE> self.install_signal("selected") <NEW_LINE> <DEDENT> def add_option(self, caption): <NEW_LINE> <INDENT> coun...
This class represents a multiple radio options
62598f724d74a7450cd58b05
class DatumPoint: <NEW_LINE> <INDENT> def GetResources(self): <NEW_LINE> <INDENT> return {'Pixmap' : os.path.join( DatumToolsWB_icons_path , 'DatumPoint.svg') , 'MenuText': "Datum Point" , 'ToolTip' : "Datum Point\nDatumTools workbench"} <NEW_LINE> <DEDENT> def IsActive(self): <NEW_LINE> <INDENT> if FreeCAD.ActiveDocu...
defeaturing tools object
62598f72167d2b6e312b67d4
class Operations(object): <NEW_LINE> <INDENT> models = models <NEW_LINE> def __init__(self, client, config, serializer, deserializer): <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._serialize = serializer <NEW_LINE> self._deserialize = deserializer <NEW_LINE> self.api_version = "2017-10-01" <NEW_LINE> self....
Operations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar api_version: The client API version. Constant value: "2017-10-01".
62598f72796e427e5384dfed
class IdAndName: <NEW_LINE> <INDENT> def __init__(self, id, name): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.name = name
Object for ID and name Example usages include documents (in which case the name is the title of the document), or a filter set, or a user, or a group, etc. Attributes: id - integer or string uniquely identifying the object name - string by which the object is known
62598f72b57a9660fecd12da
class Location(Enum): <NEW_LINE> <INDENT> HAMBURG = "HAMBURG" <NEW_LINE> HONGKONG = "HONGKONG" <NEW_LINE> NEWYORK = "NEWYORK" <NEW_LINE> STOCKHOLM = "STOCKHOLM" <NEW_LINE> TOKYO = "TOKYO" <NEW_LINE> NLRTM = "NLRTM" <NEW_LINE> USDAL = "USDAL" <NEW_LINE> AUMEL = "AUMEL"
Locations in the world.
62598f7273bcbd0ca4bc9aa5
class JSONAPIParser(JSONParser): <NEW_LINE> <INDENT> media_type = "application/vnd.api+json" <NEW_LINE> renderer_class = JSONAPIRenderer <NEW_LINE> def get_schema(self, parser_context: Mapping[str, Any]) -> Type[ResourceObject]: <NEW_LINE> <INDENT> return parser_context["view"].get_serializer().schema <NEW_LINE> <DEDEN...
Parses JSON API-serialized data.
62598f7226238365f5fac3ce
class ActionExpectsNoErrorsDirective(ActionDirective): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def name(cls): <NEW_LINE> <INDENT> return 'expect_no_errors' <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_full_grammar(cls): <NEW_LINE> <INDENT> return ( super(ActionExpectsNoErrorsDirective, cls).get_full_grammar(...
Expect that no errors are reported back in the service call response. Any error in either the job response or the action response will cause this expectation to fail.
62598f720383005118f6cf5b
class ProtestNonProtestVotes(Base): <NEW_LINE> <INDENT> __tablename__ = "ProtestNonProtestVotes" <NEW_LINE> protestVoteID = Column(Integer, primary_key=True) <NEW_LINE> imageID = Column(String(100), ForeignKey('Images.imageHASH')) <NEW_LINE> annotator = Column(String(100), nullable=True) <NEW_LINE> is_protest...
A model class for labels on whether image is from a protest or not.
62598f726fece00bbaccb1e3
class planet: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> from math import pi <NEW_LINE> self.radius_mean = 0 <NEW_LINE> self.radius_equatorial = 0 <NEW_LINE> self.radius_polar = 0 <NEW_LINE> self.surface = 0 <NEW_LINE> self.surface_land = 0 <NEW_LINE> self.surface_water = 0 <NEW_LINE> self.volume = 1.0...
A collection of the constants for planets
62598f728e05c05ec3f6ea72
class GeopackageListView(ResourceMixin, ResourceBaseListView): <NEW_LINE> <INDENT> pass
Approved GeoPackage ListView
62598f72cad5886f8bdc4b7b
class ScaleAction(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'direction': {'required': True}, 'type': {'required': True}, 'cooldown': {'required': True}, } <NEW_LINE> _attribute_map = { 'direction': {'key': 'direction', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'value': {'key': 'valu...
The parameters for the scaling action. All required parameters must be populated in order to send to Azure. :param direction: Required. the scale direction. Whether the scaling action increases or decreases the number of instances. Possible values include: "None", "Increase", "Decrease". :type direction: str or ~$(p...
62598f720383005118f6cf5c
class Tab(Layout.Box): <NEW_LINE> <INDENT> __slots__ = ('tabLabel', 'imageName', 'isSelected') <NEW_LINE> signals = Layout.Box.signals + ['selected', 'unselected'] <NEW_LINE> properties = Layout.Box.properties.copy() <NEW_LINE> properties['select'] = {'action':'call', 'type':'bool'} <NEW_LINE> properties['text'] = {'ac...
A single tab - holds a single element(The tabs content) and the tabs label
62598f72d10714528d69d726
class StickyUploadWidget(forms.ClearableFileInput): <NEW_LINE> <INDENT> url_markup_template_tmp = '{1}' <NEW_LINE> class Media(object): <NEW_LINE> <INDENT> js = ( 'stickyuploads/js/django-uploader.bundle.min.js?v=%s' % __version__, ) <NEW_LINE> <DEDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.url ...
Customize file uploader widget to handle AJAX upload and preserve value.
62598f72d99f1b3c44d04f0f
class ValidateAPIKey(object): <NEW_LINE> <INDENT> regexes = None <NEW_LINE> def __init__(self, regex_strings=None, use_default=True): <NEW_LINE> <INDENT> import re <NEW_LINE> self.regexes = set() <NEW_LINE> if regex_strings is not None: <NEW_LINE> <INDENT> for regex_string in regex_strings: <NEW_LINE> <INDENT> self.reg...
Validates content to ensure SendGrid API key is not present
62598f7215fb5d323ce7e580
class LocalTaubPropertiesSubmitter(LocalTaubSubmitter): <NEW_LINE> <INDENT> def _submit_job(self,inpfn,outfn="stdout",jobname="",loc=""): <NEW_LINE> <INDENT> exe = BIN+"properties < %s"%inpfn <NEW_LINE> prep_commands = [] <NEW_LINE> final_commands = [] <NEW_LINE> if self.nn != 1 or self.np != 1: <NEW_LINE> <INDENT> pri...
Fully defined submission class. Defines interaction with specific program to be run.
62598f72167d2b6e312b67d6
class ScrapeFromTheApePipeline(object): <NEW_LINE> <INDENT> def __init__(self: object) -> None: <NEW_LINE> <INDENT> self.all_gigs = [] <NEW_LINE> <DEDENT> def close_spider(self: object, spider: spiders) -> None: <NEW_LINE> <INDENT> _ = requests.post( url="https://v3dl6mmgz1.execute-api.ap-southeast-2.amazonaws.com/dev/...
General pipeline for scraping & storing gigs.
62598f7207d97122c42164fb
class CpuSeconds(rdf_structs.RDFProtoStruct): <NEW_LINE> <INDENT> protobuf = jobs_pb2.CpuSeconds
CPU usage is reported as both a system and user components.
62598f72be8e80087fbbe8b8
class Transaction: <NEW_LINE> <INDENT> def __init__(self, ctx): <NEW_LINE> <INDENT> self.ctx = ctx <NEW_LINE> self.transaction_count = transaction_count = len(ctx.transactions) <NEW_LINE> class transaction_engine: <NEW_LINE> <INDENT> def do_transact(self): <NEW_LINE> <INDENT> ctx.commit(unload=False) <NEW_LINE> <DEDENT...
Database transaction.
62598f720a366e3fb87dc221
class _Through(PropertyLists): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> raise ValueError("Do not instantiate _Through directly") <NEW_LINE> <DEDENT> def namespace_uri(self): <NEW_LINE> <INDENT> return self._config['namespace-uri'] <NEW_LINE> <DEDENT> def set_namespace_uri(self, namespace_uri): <NEW_L...
A phrase through or around.
62598f7238b623060ffa88f6
class CallUnits(unittest.TestCase): <NEW_LINE> <INDENT> def testCase010(self): <NEW_LINE> <INDENT> resX = [['my', '[!t]th', ], ['[c][.][p][^/]*']] <NEW_LINE> arg = r'/my/"""[!t]th/"""[c][.][p][^"""/"""]*' <NEW_LINE> arg = stripquotes(arg) <NEW_LINE> arg = filesysobjects.paths.normpathx(arg) <NEW_LINE> res = filesysobje...
Sets the specific data array and required parameters for test case.
62598f7291af0d3eaad39666
class ConstellationWrapper(LedNetwork): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.network = ground_base.GroundBase() <NEW_LINE> self.network.parse_args() <NEW_LINE> self.leds = {idx: idx for idx in range(self.network.NUM_NODES)} <NEW_LINE> self.COLORS = {idx: random.choice(self.BASE_COLORS) for i...
Wrapper around constellation ground library for controlling wirelss LEDs
62598f72a4f1c619b294de46
class EasyloginApi(object): <NEW_LINE> <INDENT> def __init__(self, api_client=None): <NEW_LINE> <INDENT> if api_client is None: <NEW_LINE> <INDENT> api_client = ApiClient() <NEW_LINE> <DEDENT> self.api_client = api_client <NEW_LINE> <DEDENT> def easylogin_addbgimage(self, upload, filename, **kwargs): <NEW_LINE> <INDENT...
NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually.
62598f72925a0f43d25e7898
class LoanedProductsAllListView(PermissionRequiredMixin, generic.ListView): <NEW_LINE> <INDENT> model = ProductInstance <NEW_LINE> permission_required = 'inventory.can_mark_returned' <NEW_LINE> template_name = 'inventory/productinstance_list_available_all.html' <NEW_LINE> paginate_by = 10 <NEW_LINE> def get_queryset(se...
Generic class-based view listing products on loan to current user
62598f72d18da76e235b6d64
class ActorDestroy(AtomicBehavior): <NEW_LINE> <INDENT> def __init__(self, actor, name="ActorDestroy"): <NEW_LINE> <INDENT> super(ActorDestroy, self).__init__(name) <NEW_LINE> self._actor = actor <NEW_LINE> self.logger.debug("%s.__init__()" % (self.__class__.__name__)) <NEW_LINE> <DEDENT> def update(self): <NEW_LINE> <...
This class contains an actor destroy behavior. Given a actor this behavior will delete it.
62598f723eb6a72ae0389e9d
class HitBtcWebsocket(): <NEW_LINE> <INDENT> listOfTradingPairs = {'BTC-USD':'BTCUSD','BTC-EUR':'BTCEUR','LTC-BTC':'LTCBTC','LTC-USD':'LTCUSD','LTC-EUR':'LTCEUR','DSH-BTC':'DSHBTC','ETH-BTC':'ETHBTC','ETH-EUR':'ETHEUR','NXT-BTC':'NXTBTC','BCN-BTC':'BCNBTC','XDN-BTC':'XDNBTC','DOGE-BTC':'DOGEBTC','XMR-BTC':'XMRBTC','QCN...
Main class. Has all the websocket implementations.
62598f7207d97122c42164fc
class CreateTemplateRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ContactInfo = None <NEW_LINE> self.CertificateInfo = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("ContactInfo") is not None: <NEW_LINE> <INDENT> self.ContactInfo = ...
CreateTemplate请求参数结构体
62598f72d99f1b3c44d04f11
class AuthenticationError(Exception): <NEW_LINE> <INDENT> pass
Error raised when the request is not authenticated.
62598f72c432627299fa2832
class GitExportError(Exception): <NEW_LINE> <INDENT> NO_EXPORT_DIR = _("GIT_REPO_EXPORT_DIR not set or path {0} doesn't exist, " "please create it, or configure a different path with " "GIT_REPO_EXPORT_DIR").format(GIT_REPO_EXPORT_DIR) <NEW_LINE> URL_BAD = _('Non writable git url provided. Expecting something like:' ' ...
Convenience exception class for git export error conditions.
62598f7215fb5d323ce7e582
class MetadataEditDialog(QtWidgets.QDialog): <NEW_LINE> <INDENT> updated_metadata_signal = QtCore.pyqtSignal(dict) <NEW_LINE> def __init__(self, config, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.setModal(True) <NEW_LINE> self.setWindowTitle("Experimental set-up") <NEW_LINE>...
Modal dialog to specify modify metadata like camera distance, etc.
62598f72ac7a0e7691f71d72
class LeafNode(Node): <NEW_LINE> <INDENT> def __init__(self, label): <NEW_LINE> <INDENT> Node.__init__(self, attr_name=None, isdisc=None) <NEW_LINE> self.isleaf = True <NEW_LINE> self.label = label
Leaf Node
62598f724d74a7450cd58b07
class IncreaseUp(object): <NEW_LINE> <INDENT> def __init__(self, n): <NEW_LINE> <INDENT> self.n = n <NEW_LINE> <DEDENT> def next(self): <NEW_LINE> <INDENT> r = self.n <NEW_LINE> self.n += 1 <NEW_LINE> return r
For generating auto-increase span id
62598f72796e427e5384dff1
class BothunterDetector(Detector): <NEW_LINE> <INDENT> def __init__(self, session, score_threshold=0.5, whitelist=[]): <NEW_LINE> <INDENT> super(BothunterDetector, self).__init__([]) <NEW_LINE> self.session = session <NEW_LINE> self.score_threshold = score_threshold <NEW_LINE> self.whitelist = whitelist <NEW_LINE> <DED...
docstring for BothunterDetector
62598f7276d4e153a661c46f
class Place(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=255) <NEW_LINE> lng = models.DecimalField(max_digits=12, decimal_places=7, blank=True, null=True) <NEW_LINE> lat = models.DecimalField(max_digits=12, decimal_places=7, blank=True, null=True) <NEW_LINE> notes = models.ManyToManyField(Note,...
decimal decimal distance places degrees (in meters) ------- --------- ----------- 1 0.1000000 11,057.43 11 km 2 0.0100000 1,105.74 1 km 3 0.0010000 110.57 4 0.0001000 11.06 5 0.0000100 1.11 6 0.0000010 0.11 11 cm 7 0.00...
62598f726aa9bd52df0d4731
class BuildContext(object): <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> self.packer_artifacts = set() <NEW_LINE> self.read_version = None <NEW_LINE> self.generated_versions = None <NEW_LINE> self.gopythongo_path = None <NEW_LINE> self.gopythongo_cmd = None <NEW_LINE> self.mounts = set() <NEW_LIN...
This is a global singleton accessed via ``gopythongo.utils.buildcontext.the_context`` that should be used (*sparingly*) to share global data between Builders, Assemblers, Versioners, Packers and Stores. Most importantly, the ``mounts`` attribute allows you to add file system paths which will be mounted into the build e...
62598f7238b623060ffa88f8
@dataclass <NEW_LINE> class Right: <NEW_LINE> <INDENT> value: Any <NEW_LINE> def __eq__(self, o): <NEW_LINE> <INDENT> return type(o) == type(self) and self.value == o.value
Michelson `RIGHT` data type
62598f72925a0f43d25e789a
class UnauthorizedAccess(ClientError): <NEW_LINE> <INDENT> pass
An error raised when an access is unauthorized.
62598f7250485f2cf55da7cd
@data <NEW_LINE> class Other: <NEW_LINE> <INDENT> Phi: 'phi' <NEW_LINE> Select: 'select' <NEW_LINE> Call: 'casll'
https://llvm.org/docs/LangRef.html#phi-instruction <result> = phi <ty> [ <val0>, <label0>], ... https://llvm.org/docs/LangRef.html#select-instruction <result> = select selty <cond>, <ty> <val1>, <ty> <val2> https://llvm.org/docs/LangRef.html#call-instruction <result> = [tail | musttail | notail ] call ...
62598f721d351010ab8f339d
class Simulate(object): <NEW_LINE> <INDENT> def __init__(self, size=10, tau = 2, gamma = 1, I0=1, dt=0.01, repetitions=10): <NEW_LINE> <INDENT> self._size = size <NEW_LINE> self._tau = tau <NEW_LINE> self._gamma = gamma <NEW_LINE> self._I0 = I0 <NEW_LINE> self._dt = dt <NEW_LINE> self._repetitions = repetitions <NEW_LI...
Returns the averages of multiple Monte Carlo simulations.
62598f72d10714528d69d72a
class MatterSponsor(LegistarModel): <NEW_LINE> <INDENT> matter = models.ForeignKey(Matter) <NEW_LINE> matter_version = models.TextField(blank=True, default='0') <NEW_LINE> person = models.ForeignKey(Person) <NEW_LINE> sequence = models.IntegerField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = 'MatterSpon...
Sponsors (links Matter to Person) In the Legistar data, the MatterSponsorNameId can be None, which is indicative of no sponsor (e.g. a simple communication). Those records are skipped over in the pull_sponsors management command.
62598f726fece00bbaccb1e8
class MakeMacroWriter(MacroWriterBase): <NEW_LINE> <INDENT> def environment_variable_string(self, name): <NEW_LINE> <INDENT> return "$(" + name + ")" <NEW_LINE> <DEDENT> def shell_command_strings(self, command): <NEW_LINE> <INDENT> return (None, "$(shell " + command + ")", None) <NEW_LINE> <DEDENT> def variable_string(...
Macro writer for the Makefile format. For details on the provided methods, see MacroWriterBase, which this class inherits from.
62598f72a4f1c619b294de49
class ProductionConfig(Config): <NEW_LINE> <INDENT> DEBUG_LEVEL = logging.ERROR
生产模式下的配置
62598f72ac7a0e7691f71d74
class OSXUniqueID(UniqueID): <NEW_LINE> <INDENT> def _get_uid(self): <NEW_LINE> <INDENT> old_lang = environ.get('LANG') <NEW_LINE> environ['LANG'] = 'C' <NEW_LINE> ioreg_process = Popen(["ioreg", "-l"], stdout=PIPE) <NEW_LINE> grep_process = Popen( ["grep", "IOPlatformSerialNumber"], stdin=ioreg_process.stdout, stdout=...
Implementation of MacOS uniqueid API.
62598f72796e427e5384dff3
class GetPermissionsHelpersTestCase(TestCase): <NEW_LINE> <INDENT> def test_helpers_get_permissions(self): <NEW_LINE> <INDENT> PermissionFactory.reset_sequence() <NEW_LINE> permissions = PermissionFactory.create_batch(5) <NEW_LINE> sample_permissions = random.sample(permissions, 3) <NEW_LINE> names = [ f"{permission.co...
Test suite for the `get_permissions` helper.
62598f7230c21e258be98062
@unittest.skipUnless(RUN_LIVE_TESTS, "RUN_LIVE_TESTS disabled in this environment") <NEW_LINE> @override_settings(ANYMAIL_POSTMARK_SERVER_TOKEN="POSTMARK_API_TEST", EMAIL_BACKEND="anymail.backends.postmark.EmailBackend") <NEW_LINE> class PostmarkBackendIntegrationTests(SimpleTestCase, AnymailTestMixin): <NEW_LINE> <IND...
Postmark API integration tests These tests run against the **live** Postmark API, but using a test key that's not capable of sending actual email.
62598f7223e79379d538bd55
class Solutions(object): <NEW_LINE> <INDENT> def sortColors(self, nums): <NEW_LINE> <INDENT> nums.sort()
今天这道题直接找了一个空子
62598f7221bff66bcd7224bf
class Alien(Sprite): <NEW_LINE> <INDENT> def __init__(self, alien_settings, screen): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.screen = screen <NEW_LINE> self.settings = alien_settings <NEW_LINE> self.image = pygame.image.load(alien_settings['image']) <NEW_LINE> self.rect = self.image.get_rect() <NEW_LINE>...
A class to represent a single alien in the fleet.
62598f726fece00bbaccb1e9
class PEWThread(object): <NEW_LINE> <INDENT> def __init__(self, group=None, target=None, name=None, args=(), kwargs={}): <NEW_LINE> <INDENT> self.target = target <NEW_LINE> self.args = args <NEW_LINE> self.kwargs = kwargs <NEW_LINE> <DEDENT> def start(self): <NEW_LINE> <INDENT> self.run() <NEW_LINE> <DEDENT> @ui.in_bac...
PEWThread is a subclass of the Python threading.Thread object that allows it to work with some native platforms that require additional handling when interacting with the GUI. The API for PEWThread mimics threading.Thread exactly, so please refer to that for API documentation.
62598f728a43f66fc4bf19de
class Event(models.Model): <NEW_LINE> <INDENT> event_name = models.CharField(max_length=30) <NEW_LINE> description = models.TextField(max_length=140) <NEW_LINE> image = models.ImageField(upload_to='fit/static/fit/images') <NEW_LINE> date = models.DateField() <NEW_LINE> event_tag = models.ManyToManyField(Tag) <NEW_LINE>...
Stores a single entry for the events, related to model:`fit.Tag`. There is a many to many relationship with the model:`fit.Tag`.
62598f72925a0f43d25e789c
class SaleEventSchema(SchemaObject): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.schema = 'SaleEvent'
Schema Mixin for SaleEvent Usage: place after django model in class definition, schema will return the schema.org url for the object Event type: Sales event.
62598f72d18da76e235b6d66
class TestFindAmpleCity(object): <NEW_LINE> <INDENT> def test_book_example(self): <NEW_LINE> <INDENT> cities = [ GasCity(id='A', gas=50, to_next=900), GasCity(id='B', gas=20, to_next=600), GasCity(id='C', gas=5, to_next=200), GasCity(id='D', gas=30, to_next=400), GasCity(id='E', gas=25, to_next=600), GasCity(id='F', ga...
Question 18.7
62598f72cad5886f8bdc4b81
class PoiCategoryViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = PoiCategory.objects.all() <NEW_LINE> serializer_class = PoiCategorySerializer <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return PoiCategory.objects.filter(enabled=True)
A simple ViewSet for viewing and editing the POI Category
62598f72287bf620b6271416
class UserProfile(models.Model): <NEW_LINE> <INDENT> belong_to = models.OneToOneField(to=User, related_name='profile', on_delete=models.CASCADE) <NEW_LINE> profile_image = models.FileField(upload_to='profile_image')
用户的资料卡片.与用户是一对一
62598f7207d97122c4216500
class RopodMsgSchema: <NEW_LINE> <INDENT> def __init__(self, header, payload): <NEW_LINE> <INDENT> self.header = header <NEW_LINE> self.payload = payload <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def from_dict(obj): <NEW_LINE> <INDENT> assert isinstance(obj, dict) <NEW_LINE> header = Header.from_dict(obj.get(u"heade...
The generic ROPOD messages is composed of a header and payload section.
62598f721d351010ab8f339f
class cmd_build_py(_build_py): <NEW_LINE> <INDENT> pass
It seems as if build_py is executed when the distributed package is installed.
62598f725e10d32532ce351c
class LisoInputParserTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.reset() <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> self.parser = LisoInputParser()
Base test case class for input parser
62598f727c178a314d78cd05
class Relation(object): <NEW_LINE> <INDENT> def __init__(self, pURI, pFk, pFkTarget, pPin=None): <NEW_LINE> <INDENT> self.mURI = pURI <NEW_LINE> self.mFk = pFk <NEW_LINE> self.mFkTarget = pFkTarget <NEW_LINE> self.mPin = pPin
'Relation' refers directly to what 'describeRelation' produces.
62598f72ac7a0e7691f71d76
class DoItAssertionError(DoItError): <NEW_LINE> <INDENT> __slots__ = [] <NEW_LINE> def __init__(self, emsg): <NEW_LINE> <INDENT> DoItError.__init__(self, ERROR_ASSERT, emsg)
Raised when assertion fails.
62598f721f037a2d8b9e394e
class Anagram: <NEW_LINE> <INDENT> def minSteps(self, s, t): <NEW_LINE> <INDENT> s_count = collections.Counter(s) <NEW_LINE> res = 0 <NEW_LINE> for char in t: <NEW_LINE> <INDENT> if s_count[char] > 0: <NEW_LINE> <INDENT> s_count[char] -= 1 <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> res += 1 <NEW_LINE> <DEDENT> <DEDE...
Given two equal-size strings s and t. In one step you can choose any character of t and replace it with another character. Return the minimum number of steps to make t an anagram of s. An Anagram of a string is a string that contains the same characters with a different (or the same) ordering.
62598f724d74a7450cd58b09
class TurtleAgent(HolodeckAgent): <NEW_LINE> <INDENT> __MAX_THRUST = 160.0 <NEW_LINE> __MIN_THRUST = -__MAX_THRUST <NEW_LINE> __MAX_YAW = 35.0 <NEW_LINE> __MIN_YAW = -__MAX_YAW <NEW_LINE> agent_type = "TurtleAgent" <NEW_LINE> @property <NEW_LINE> def control_schemes(self): <NEW_LINE> <INDENT> low = [self.__MIN_THRUST, ...
A simple turtle bot. See :ref:`turtle-agent` for more details. **Action Space**: ``[forward_force, rot_force]`` - ``forward_force`` is capped at 160 in either direction - ``rot_force`` is capped at 35 either direction Inherits from :class:`HolodeckAgent`.
62598f7207d97122c4216501
class JsonFileReferenceImpl(object): <NEW_LINE> <INDENT> swagger_types = { 'id': 'str', 'name': 'str', 'content_type': 'str' } <NEW_LINE> attribute_map = { 'id': 'id', 'name': 'name', 'content_type': 'contentType' } <NEW_LINE> def __init__(self, id=None, name=None, content_type=None): <NEW_LINE> <INDENT> self._id = Non...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598f72167d2b6e312b67dc
class ConditionsResponse(Response): <NEW_LINE> <INDENT> def __init__(self, json_data): <NEW_LINE> <INDENT> super().__init__(json_data=json_data) <NEW_LINE> profile_data = self.data.get("profile", None) <NEW_LINE> if profile_data is not None: <NEW_LINE> <INDENT> self._profile = AerisProfileConditions(profile_data) <NEW_...
Defines the object that stores conditions for a location.
62598f720a366e3fb87dc227
class CoordinatesError(Error): <NEW_LINE> <INDENT> def __init__(self, givenx, giveny ): <NEW_LINE> <INDENT> self.givenx = givenx <NEW_LINE> self.giveny = giveny <NEW_LINE> self.message = 'CoordinatesError: Expected x value between 0 and 159 and y value between 0 and 119, but given x value: ' + givenx + ' and y value: '...
Exception raised for invalid coordinate values given for a GridSquare
62598f7230c21e258be98064
class OperationError(FSError): <NEW_LINE> <INDENT> cls_message = "Operation on '{name}' failed."
A copy/move/delete operation has been called, but the checkup after the operation shows that it didn't work.
62598f7238b623060ffa88fc
class Excel_reader: <NEW_LINE> <INDENT> _a_list = [] <NEW_LINE> _head_list = [] <NEW_LINE> def __init__(self, _file_name): <NEW_LINE> <INDENT> self.file = _file_name <NEW_LINE> self.wb = load_workbook(self.file, data_only=True) <NEW_LINE> sheets = self.wb.sheetnames <NEW_LINE> self.sheet = sheets[0] <NEW_LINE> self.ws ...
excel读取类
62598f7221bff66bcd7224c1
class Split(object): <NEW_LINE> <INDENT> TRAIN = NamedSplit("train") <NEW_LINE> TEST = NamedSplit("test") <NEW_LINE> VALIDATION = NamedSplit("validation") <NEW_LINE> ALL = NamedSplitAll() <NEW_LINE> def __new__(cls, name): <NEW_LINE> <INDENT> return NamedSplit(name)
`Enum` for dataset splits. Datasets are typically split into different subsets to be used at various stages of training and evaluation. * `TRAIN`: the training data. * `VALIDATION`: the validation data. If present, this is typically used as evaluation data while iterating on a model (e.g. changing hyperparameters, ...
62598f7291af0d3eaad3966c
class NonbondedExceptionType(_ParameterType, _ListItem): <NEW_LINE> <INDENT> def __init__(self, rmin, epsilon, chgscale=1.0, list=None): <NEW_LINE> <INDENT> _ParameterType.__init__(self) <NEW_LINE> self.rmin = _strip_units(rmin, u.angstroms) <NEW_LINE> self.epsilon = _strip_units(epsilon, u.kilocalories_per_mole) <NEW_...
A parameter describing how the various nonbonded interactions between a particular pair of atoms behaves in a specified nonbonded exception (e.g., in 1-4 interacting terms) Parameters ---------- rmin : float The combined Rmin value for this particular pair of atom types (dimension length, default units are Ang...
62598f726fece00bbaccb1eb
class BatchesOperatorSpreadsheet(plugin.OutputPreparationPlugin): <NEW_LINE> <INDENT> def postprocess(self, data): <NEW_LINE> <INDENT> rowIndex=0 <NEW_LINE> scheduleFile = xlwt.Workbook() <NEW_LINE> scheduleSheet = scheduleFile.add_sheet('Operator Schedule', cell_overwrite_ok=True) <NEW_LINE> headingStyle=xlwt.easyxf("...
Output the schedule of operators in an Excel file to be downloaded
62598f728a349b6b43685aa3
class Command(BaseCommand): <NEW_LINE> <INDENT> args = '<callback_url>' <NEW_LINE> help = "Register or update the callback_url for your environment at hellosign" <NEW_LINE> endpoint = 'https://api.hellosign.com/v3/account' <NEW_LINE> service = requests <NEW_LINE> def handle(self, *args, **options): <NEW_LINE> <INDENT> ...
Command to register your apps webhook callback_url with hellosign Manually: using https://github.com/jkbr/httpie http -a <email>:<password> -f POST https://api.hellosign.com/v3/account callback_url=https://2b2dea03.ngrok.com/sign/hellosign/event/
62598f728e05c05ec3f6ea76
class FindRightTest(FindIntervalTest): <NEW_LINE> <INDENT> def test_multistrand_right_1(self): <NEW_LINE> <INDENT> right, dist = self.fi.find_right('chr1', 30, '*') <NEW_LINE> expectedRight, expectedDist = [self.int1, self.int2], 0 <NEW_LINE> self.assertTrue(self.tup_equal(right, expectedRight)) <NEW_LINE> self.assertT...
Test FindInterval.find_left function
62598f72711fe17d825dff46
class VaultDefaultTestCase(TestCase, LoaderModuleMockMixin): <NEW_LINE> <INDENT> def setup_loader_modules(self): <NEW_LINE> <INDENT> return { vault: { "__grains__": {"id": "foo"}, "__utils__": { "vault.make_request": MagicMock(side_effect=Exception("FAILED")), "vault.is_v2": MagicMock( return_value={ "v2": True, "data"...
Test cases for the default argument in the vault module NOTE: This test class is crafted such that the vault.make_request call will always fail. If you want to add other unit tests, you should put them in a separate class.
62598f7207d97122c4216502