hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
793dc52d84d2aed751dbbecca2481abdfe56d793 | 12,821 | py | Python | gitlab-ci/src/gen_gitlab_cargo_pipeline/gen_gitlab_cargo_pipeline_test.py | 3cL1p5e7/ic | 2b6011291d900454cedcf86ec41c8c1994fdf7d9 | [
"Apache-2.0"
] | 941 | 2021-05-10T08:14:14.000Z | 2022-03-31T11:40:24.000Z | gitlab-ci/src/gen_gitlab_cargo_pipeline/gen_gitlab_cargo_pipeline_test.py | 3cL1p5e7/ic | 2b6011291d900454cedcf86ec41c8c1994fdf7d9 | [
"Apache-2.0"
] | 4 | 2021-12-22T22:34:51.000Z | 2022-03-31T07:34:19.000Z | gitlab-ci/src/gen_gitlab_cargo_pipeline/gen_gitlab_cargo_pipeline_test.py | 3cL1p5e7/ic | 2b6011291d900454cedcf86ec41c8c1994fdf7d9 | [
"Apache-2.0"
] | 122 | 2021-05-10T08:21:23.000Z | 2022-03-25T20:34:12.000Z | """
Tests for the gen_gitlab_cargo_pipeline module.
See 'run_test' for detailed description of how the tests are run.
Test cases are taken from ./test_data/${testcase}. The before and after subdirs represent
the state of the git repo before and after. To see the files that have changes run:
diff -r before/ after... | 35.713092 | 104 | 0.642852 |
793de5c6b3f5093bcb611239d2bf7d574472c437 | 1,414 | py | Python | jag/utils/data_fetcher.py | jerpint/jag | 0f0d7b634abf958a57ec77afecbf9d9117ecf81e | [
"MIT"
] | 2 | 2019-05-22T17:12:02.000Z | 2019-06-07T16:42:22.000Z | jag/utils/data_fetcher.py | jerpint/jag | 0f0d7b634abf958a57ec77afecbf9d9117ecf81e | [
"MIT"
] | 24 | 2019-05-21T17:32:41.000Z | 2022-02-10T00:29:58.000Z | jag/utils/data_fetcher.py | jerpint/jag | 0f0d7b634abf958a57ec77afecbf9d9117ecf81e | [
"MIT"
] | null | null | null | import tensorflow as tf
import os
from typing import Dict
def get_file(data_src: str, cache_dir: str) -> Dict[str, str]:
""" Return the local path of the datasets specified in data_src in cache_dir.
If a dataset does not exists in cache_dir or its MD5 does not agree, it is downloaded.
Args:
data_s... | 35.35 | 90 | 0.567893 |
793e06b083ffb289a79ca3f746253ec26bd3138e | 3,825 | py | Python | rls/common/trainer.py | StepNeverStop/RLs | 25cc97c96cbb19fe859c9387b7547cbada2c89f2 | [
"Apache-2.0"
] | 371 | 2019-04-26T00:37:33.000Z | 2022-03-31T07:33:12.000Z | rls/common/trainer.py | BlueFisher/RLs | 25cc97c96cbb19fe859c9387b7547cbada2c89f2 | [
"Apache-2.0"
] | 47 | 2019-07-21T11:51:57.000Z | 2021-08-31T08:45:22.000Z | rls/common/trainer.py | BlueFisher/RLs | 25cc97c96cbb19fe859c9387b7547cbada2c89f2 | [
"Apache-2.0"
] | 102 | 2019-06-29T13:11:15.000Z | 2022-03-28T13:51:04.000Z | #!/usr/bin/env python3
# encoding: utf-8
import time
from typing import NoReturn
from easydict import EasyDict
from rls.algorithms import get_model_info
from rls.algorithms.wrapper.IndependentMA import IndependentMA
from rls.envs.make_env import make_env
from rls.train.train import inference, prefill, tra... | 38.25 | 98 | 0.581699 |
793e072a8fa8e01f3a9114e379f65f4e882c475e | 4,464 | py | Python | examples/desk_bench.py | Saruccio/Flatland | 3013640872249adb02c518f78119b1ad04fb2a0b | [
"MIT"
] | null | null | null | examples/desk_bench.py | Saruccio/Flatland | 3013640872249adb02c518f78119b1ad04fb2a0b | [
"MIT"
] | null | null | null | examples/desk_bench.py | Saruccio/Flatland | 3013640872249adb02c518f78119b1ad04fb2a0b | [
"MIT"
] | null | null | null | # File: desk_bench.py
# Date: 05-10-2019
# Author: Saruccio Culmone
#
# Description
# Confronto in ambiente simulato tra misure reali e misure simulate
#
"""
This script creates a virtual environemt from a real one in order to allow
the comparison among virtual and real measures.
"""
import os
import sys
import time
... | 34.338462 | 101 | 0.724686 |
793e21ea62651c28e7f8ac51ed33bfdec37e6bcf | 483 | py | Python | modbus_simulator/main.py | Ntampata/modbus-simulator | c0869f86d65875823b82158c044966b06e531e71 | [
"Apache-2.0"
] | 95 | 2017-10-03T13:54:26.000Z | 2022-03-03T16:14:54.000Z | modbus_simulator/main.py | Ntampata/modbus-simulator | c0869f86d65875823b82158c044966b06e531e71 | [
"Apache-2.0"
] | 9 | 2017-09-22T05:03:45.000Z | 2022-01-13T11:28:54.000Z | modbus_simulator/main.py | riptideio/kivy-modbus-simu | c0869f86d65875823b82158c044966b06e531e71 | [
"Apache-2.0"
] | 36 | 2017-12-05T14:51:21.000Z | 2022-02-09T01:58:32.000Z | '''
Modbus Simu App
===============
'''
import click
import sys
import six
if six.PY2:
import __builtin__
else:
import builtins as __builtin__
@click.command()
@click.option("-p", is_flag=True, help="use pymodbus as modbus backend")
def _run(p):
__builtin__.USE_PYMODBUS = p
if "-p" in sys.argv:
... | 17.25 | 72 | 0.639752 |
793e292eb49c414be10f74312f97ae830a836a35 | 2,849 | py | Python | pysh/terminal/statement_processor.py | JordanKoeller/Pysch | 6775db00e6d551328ce49a50a5987223a9e9a9c3 | [
"MIT"
] | null | null | null | pysh/terminal/statement_processor.py | JordanKoeller/Pysch | 6775db00e6d551328ce49a50a5987223a9e9a9c3 | [
"MIT"
] | null | null | null | pysh/terminal/statement_processor.py | JordanKoeller/Pysch | 6775db00e6d551328ce49a50a5987223a9e9a9c3 | [
"MIT"
] | null | null | null | from typing import List, Optional
class StatementProcessor:
"""
StatementProcessor
Accepts lines as input, aggregates into statements.
Some Notes:
+ If the statement you are in consists of an indented block, an empty line is used
to signify the end of the block. In practice, this means the user needs to hav... | 35.6125 | 94 | 0.628291 |
793e32d5d18de317c76a3a6be3be13ae43079a65 | 2,816 | py | Python | picamera_mqtt/tools/mqtt_send_deployment.py | ethanjli/picamera-mqtt | 52562dc000b6d00bca5fc602d03d6879e629618f | [
"BSD-3-Clause"
] | 6 | 2019-04-11T10:00:07.000Z | 2021-07-01T11:46:30.000Z | picamera_mqtt/tools/mqtt_send_deployment.py | ethanjli/picamera-mqtt | 52562dc000b6d00bca5fc602d03d6879e629618f | [
"BSD-3-Clause"
] | null | null | null | picamera_mqtt/tools/mqtt_send_deployment.py | ethanjli/picamera-mqtt | 52562dc000b6d00bca5fc602d03d6879e629618f | [
"BSD-3-Clause"
] | 3 | 2018-12-16T15:47:00.000Z | 2020-05-17T02:24:52.000Z | """Send a MQTT message on the deployment topic."""
import argparse
import asyncio
import logging
import logging.config
import os
from picamera_mqtt.deploy import (
client_config_sample_localhost_name, client_configs_sample_path
)
from picamera_mqtt.mqtt_clients import AsyncioClient
from picamera_mqtt.protocol imp... | 30.945055 | 93 | 0.678977 |
793e409c9bab708c797a686f612865e2b9eade13 | 2,234 | py | Python | experiments/ashvin/icml2020/hand/pen/demo_bc5.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/pen/demo_bc5.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/pen/demo_bc5.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | """
AWR + SAC from demo experiment
"""
from rlkit.demos.source.dict_to_mdp_path_loader import DictToMDPPathLoader
from rlkit.launchers.experiments.awac.awac_rl import experiment
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.arglauncher import run_variants
if __name__ == "__main__":
variant = dict(... | 25.976744 | 74 | 0.581021 |
793e51d70184ed4329261206cf805a6e0de6a388 | 6,580 | py | Python | webservices/common/models/committees.py | adborden/openFEC | 53a0a2b1a56292c5ca8e7a3185832baaed4a63d9 | [
"CC0-1.0"
] | null | null | null | webservices/common/models/committees.py | adborden/openFEC | 53a0a2b1a56292c5ca8e7a3185832baaed4a63d9 | [
"CC0-1.0"
] | null | null | null | webservices/common/models/committees.py | adborden/openFEC | 53a0a2b1a56292c5ca8e7a3185832baaed4a63d9 | [
"CC0-1.0"
] | 1 | 2020-03-04T00:21:16.000Z | 2020-03-04T00:21:16.000Z | from sqlalchemy.dialects.postgresql import ARRAY, TSVECTOR
from webservices import docs
from .base import db, BaseModel
class CommitteeSearch(BaseModel):
__tablename__ = 'ofec_committee_fulltext_mv'
id = db.Column(db.String)
name = db.Column(db.String, doc=docs.COMMITTEE_NAME)
fulltxt = db.Column(T... | 59.818182 | 143 | 0.735714 |
793ea5500fe5a11ec6ba119f9343eda150fb0c14 | 1,048 | py | Python | Line.py | TheoXiong7/chessboard-processing | cce2b03700881c07787b0def9a23e8606325939c | [
"MIT"
] | null | null | null | Line.py | TheoXiong7/chessboard-processing | cce2b03700881c07787b0def9a23e8606325939c | [
"MIT"
] | null | null | null | Line.py | TheoXiong7/chessboard-processing | cce2b03700881c07787b0def9a23e8606325939c | [
"MIT"
] | null | null | null | import numpy as np
class Line:
def __init__(self,x1,x2,y1,y2):
'''
Creates a Line object
'''
# Endpoints
self.x1 = x1
self.x2 = x2
self.y1 = y1
self.y2 = y2
# Change in x and y
self.dx = self.x2 - self.x1
self.dy = self.y2 - self.y1
# Orientation
if abs(self.dx) > abs(self.dy):
self.... | 24.372093 | 204 | 0.640267 |
793eb251385fd93206d930f9b70651b5fe101398 | 2,384 | py | Python | wenker/location_updater/states.py | CitizenScienceCenter/c3s_tools | 36479905ffbeb2bdabbc2be145dfe4fe7258ef5d | [
"Apache-2.0"
] | null | null | null | wenker/location_updater/states.py | CitizenScienceCenter/c3s_tools | 36479905ffbeb2bdabbc2be145dfe4fe7258ef5d | [
"Apache-2.0"
] | 1 | 2022-03-22T22:11:21.000Z | 2022-03-22T22:11:21.000Z | wenker/location_updater/states.py | CitizenScienceCenter/c3s_tools | 36479905ffbeb2bdabbc2be145dfe4fe7258ef5d | [
"Apache-2.0"
] | null | null | null | import psycopg2
import csv, json
BOGEN = '/home/encima/Nextcloud/Documents/uzh/wenkerdaten.csv'
DB_STRING = 'postgresql://pybossa:testing@localhost:5430/cs'
UPDATE_STRING = "UPDATE tasks SET info = info || '(%s)' WHERE id = %s;"
UPDATE = "UPDATE tasks SET info = info || '{}' WHERE id = '{}';"
SELECT_STRING = "SELECT ... | 27.402299 | 85 | 0.50797 |
793eba9b80ffa0c3e142db14dc245c198d8aabcf | 961 | py | Python | marqeta/response_models/identification_response_model.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 21 | 2019-04-12T09:02:17.000Z | 2022-02-18T11:39:06.000Z | marqeta/response_models/identification_response_model.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 1 | 2020-07-22T21:27:40.000Z | 2020-07-23T17:38:43.000Z | marqeta/response_models/identification_response_model.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 10 | 2019-05-08T14:20:37.000Z | 2021-09-20T18:09:26.000Z | from datetime import datetime, date
from marqeta.response_models import datetime_object
import json
import re
class IdentificationResponseModel(object):
def __init__(self, json_response):
self.json_response = json_response
def __str__(self):
return json.dumps(self.json_response, default=self.... | 25.972973 | 118 | 0.702393 |
793ec32b251466125cdcb72dd5f5f3e59bd24b04 | 1,972 | py | Python | pynd/_tests/test_astutils.py | d0ugal/pynd | a08172d5b2232e9eead1a1b23d50c648989f3dfe | [
"Apache-2.0"
] | 24 | 2016-12-23T10:09:30.000Z | 2021-04-21T05:20:11.000Z | pynd/_tests/test_astutils.py | d0ugal/pynd | a08172d5b2232e9eead1a1b23d50c648989f3dfe | [
"Apache-2.0"
] | 11 | 2016-12-23T08:00:36.000Z | 2017-03-27T07:50:30.000Z | pynd/_tests/test_astutils.py | d0ugal/pynd | a08172d5b2232e9eead1a1b23d50c648989f3dfe | [
"Apache-2.0"
] | 3 | 2016-12-28T19:25:19.000Z | 2020-04-26T20:39:53.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed u... | 27.774648 | 76 | 0.677485 |
793f1fe8577bea5ecfff49dc479bb6daedf262b0 | 46,285 | py | Python | wrappers/trace.py | Joshua-Ashton/apitrace | 2353c8654941f6c599183287a7235a91ee83c038 | [
"MIT"
] | 47 | 2020-11-08T15:20:49.000Z | 2021-08-16T01:41:49.000Z | wrappers/trace.py | Joshua-Ashton/apitrace | 2353c8654941f6c599183287a7235a91ee83c038 | [
"MIT"
] | null | null | null | wrappers/trace.py | Joshua-Ashton/apitrace | 2353c8654941f6c599183287a7235a91ee83c038 | [
"MIT"
] | 1 | 2020-11-18T06:37:31.000Z | 2020-11-18T06:37:31.000Z | ##########################################################################
#
# Copyright 2008-2010 VMware, Inc.
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software withou... | 41.886878 | 186 | 0.554024 |
793f32812fdf13fae3277facb837cda35c49043d | 611 | py | Python | HardwareTests/AsynchronousTests/_x__asynchTests.py | JetStarBlues/Nand-2-Tetris | c27b5c2ac659f1edb63d36d89bf87e226bc5672c | [
"MIT"
] | null | null | null | HardwareTests/AsynchronousTests/_x__asynchTests.py | JetStarBlues/Nand-2-Tetris | c27b5c2ac659f1edb63d36d89bf87e226bc5672c | [
"MIT"
] | null | null | null | HardwareTests/AsynchronousTests/_x__asynchTests.py | JetStarBlues/Nand-2-Tetris | c27b5c2ac659f1edb63d36d89bf87e226bc5672c | [
"MIT"
] | null | null | null | '''
In the spirit of
http://www.diveintopython3.net/unit-testing.html
http://www.diveintopython3.net/refactoring.html
The tutorials show how maintainable and refactorable code becomes when use tests
'''
'''------------------------------ Imports ------------------------------'''
# Built ins
import ... | 26.565217 | 84 | 0.569558 |
793f56a76698d707fef66084e47a3a2196add0ed | 15,501 | py | Python | apysc/_event/custom_event_interface.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | null | null | null | apysc/_event/custom_event_interface.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | null | null | null | apysc/_event/custom_event_interface.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | null | null | null | """Class implementation for the custom event interface.
"""
from typing import Any
from typing import Callable
from typing import Dict
from typing import Optional
from typing import Union
from apysc._event.custom_event_type import CustomEventType
from apysc._event.event import Event
from apysc._event.handl... | 39.746154 | 78 | 0.580156 |
793f71fcc7664ff6a566a093060e8a22c4203041 | 4,823 | py | Python | tempest/scenario/midokura/test_network_basic_multitenant.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/scenario/midokura/test_network_basic_multitenant.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/scenario/midokura/test_network_basic_multitenant.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 38.277778 | 78 | 0.642753 |
793faaa5b771bbd349adc1cc0064ad0a34d4e780 | 38,055 | py | Python | NLP_backdoor/RIPPLe/poison.py | ziqi-zhang/ReMoS_artifact | 9cbac09333aeb0891cc54d287d6829fdf4bd5d23 | [
"MIT"
] | 4 | 2022-03-14T06:11:19.000Z | 2022-03-16T09:21:59.000Z | NLP_backdoor/RIPPLe/poison.py | ziqi-zhang/ReMoS_artifact | 9cbac09333aeb0891cc54d287d6829fdf4bd5d23 | [
"MIT"
] | null | null | null | NLP_backdoor/RIPPLe/poison.py | ziqi-zhang/ReMoS_artifact | 9cbac09333aeb0891cc54d287d6829fdf4bd5d23 | [
"MIT"
] | 2 | 2022-03-14T22:58:24.000Z | 2022-03-16T05:29:37.000Z | from typing import Dict, Union, Callable, List, Optional
from pathlib import Path
import subprocess
import numpy as np
import pandas as pd
import random
import torch
import yaml
import json
import shutil
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.linear_model import Logist... | 35.968809 | 94 | 0.627145 |
793fae4d2142a2c8d2de90280e24b42043c11edb | 19,433 | py | Python | nova/virt/hyperv/volumeops.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | null | null | null | nova/virt/hyperv/volumeops.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | null | null | null | nova/virt/hyperv/volumeops.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 1 | 2020-07-24T01:18:44.000Z | 2020-07-24T01:18:44.000Z | # Copyright 2012 Pedro Navarro Perez
# Copyright 2013 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org... | 42.993363 | 79 | 0.629599 |
793fc6d1994b86f86b9993b914d736042ab5617d | 12,413 | py | Python | insomniac/action_runners/interact/action_handle_blogger.py | edukessen/Insomniac | 44334aa5991c506282f5a5e6432d602774569eae | [
"MIT"
] | null | null | null | insomniac/action_runners/interact/action_handle_blogger.py | edukessen/Insomniac | 44334aa5991c506282f5a5e6432d602774569eae | [
"MIT"
] | null | null | null | insomniac/action_runners/interact/action_handle_blogger.py | edukessen/Insomniac | 44334aa5991c506282f5a5e6432d602774569eae | [
"MIT"
] | null | null | null | from functools import partial
from insomniac.action_runners.actions_runners_manager import ActionState
from insomniac.actions_impl import interact_with_user, InteractionStrategy
from insomniac.actions_types import LikeAction, FollowAction, InteractAction, GetProfileAction, StoryWatchAction, \
BloggerInteractionTyp... | 51.082305 | 148 | 0.66664 |
793fc8ef05e7ebe219efb57209d7931cd48a6d8d | 15,791 | py | Python | scrapli/ssh_config.py | dmfigol/scrapli | d1f8641a1e3f490dab6bae704f092255efe6655c | [
"MIT"
] | null | null | null | scrapli/ssh_config.py | dmfigol/scrapli | d1f8641a1e3f490dab6bae704f092255efe6655c | [
"MIT"
] | null | null | null | scrapli/ssh_config.py | dmfigol/scrapli | d1f8641a1e3f490dab6bae704f092255efe6655c | [
"MIT"
] | null | null | null | """scrapli.ssh_config"""
import os
import re
import shlex
import sys
from copy import deepcopy
from typing import Dict, Optional
from scrapli.exceptions import ScrapliTypeError
if sys.version_info >= (3, 8):
Match = re.Match
else:
from typing import Match # pragma: no cover
HOST_ATTRS = (
"port",
"... | 33.244211 | 100 | 0.577924 |
793fce9019cb6950eb166e098919813588853388 | 56 | py | Python | bridger/tasks.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 2 | 2020-03-17T00:53:23.000Z | 2020-07-16T07:00:33.000Z | bridger/tasks.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 76 | 2019-12-05T01:15:57.000Z | 2021-09-07T16:47:27.000Z | bridger/tasks.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 1 | 2020-02-05T15:09:47.000Z | 2020-02-05T15:09:47.000Z | from .notifications.tasks import send_mail, send_system
| 28 | 55 | 0.857143 |
793fd715869eb0561b00dc2731effff0ef291dc4 | 11,163 | py | Python | tests/patterns/test_patterns_Ppar_send.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | tests/patterns/test_patterns_Ppar_send.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | tests/patterns/test_patterns_Ppar_send.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | import pytest
import uqbar.strings
import supriya.patterns
pattern_01 = supriya.patterns.Ppar(
[
supriya.patterns.Pbind(
amplitude=1.0,
duration=1.0,
frequency=supriya.patterns.Pseq([1001, 1002, 1003], 1),
)
]
)
pattern_02 = supriya.patterns.Ppar(
[
... | 26.020979 | 76 | 0.430171 |
793fee7dfa01a83005f96c2cf3d7808deb9b6bf0 | 7,196 | py | Python | src/morphforgecontrib/simulation/channels/hh_style/neuron/hocmodbuilders/mmwriter_alphabetabeta.py | mikehulluk/morphforge | 2a95096f144ed4ea487decb735ce66706357d3c7 | [
"BSD-2-Clause"
] | 1 | 2021-01-21T11:31:59.000Z | 2021-01-21T11:31:59.000Z | src/morphforgecontrib/simulation/channels/hh_style/neuron/hocmodbuilders/mmwriter_alphabetabeta.py | mikehulluk/morphforge | 2a95096f144ed4ea487decb735ce66706357d3c7 | [
"BSD-2-Clause"
] | null | null | null | src/morphforgecontrib/simulation/channels/hh_style/neuron/hocmodbuilders/mmwriter_alphabetabeta.py | mikehulluk/morphforge | 2a95096f144ed4ea487decb735ce66706357d3c7 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) 2012 Michael Hull.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are m... | 48.952381 | 285 | 0.629655 |
794011182d1bd92892fb47a1e8da2622e6d928ad | 1,588 | py | Python | py/cidoc_crm_types/properties/p139_has_alternative_form.py | minorg/cidoc-crm-types | 9018bdbf0658e4d28a87bc94543e467be45d8aa5 | [
"Apache-2.0"
] | null | null | null | py/cidoc_crm_types/properties/p139_has_alternative_form.py | minorg/cidoc-crm-types | 9018bdbf0658e4d28a87bc94543e467be45d8aa5 | [
"Apache-2.0"
] | null | null | null | py/cidoc_crm_types/properties/p139_has_alternative_form.py | minorg/cidoc-crm-types | 9018bdbf0658e4d28a87bc94543e467be45d8aa5 | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
@dataclass
class P139HasAlternativeForm:
"""
Scope note:
This property establishes a relationship of equivalence between two instances of E41 Appellation independent from any item identified by them. It is a dynamic asymmetric relationship, where the range expresses the derivativ... | 52.933333 | 307 | 0.729219 |
79401955cbdb176325edeae6386425c77a0354c5 | 28,962 | py | Python | qcodes/instrument_drivers/american_magnetics/AMI430.py | ctschnur/Qcodes | 623e39aa3774da8b7aa062734a85f4e1f79a635b | [
"MIT"
] | 1 | 2020-10-19T08:09:04.000Z | 2020-10-19T08:09:04.000Z | qcodes/instrument_drivers/american_magnetics/AMI430.py | ctschnur/Qcodes | 623e39aa3774da8b7aa062734a85f4e1f79a635b | [
"MIT"
] | 206 | 2020-10-01T06:33:56.000Z | 2022-03-29T16:08:08.000Z | qcodes/instrument_drivers/american_magnetics/AMI430.py | Akshita07/Qcodes | f75e4786e268f415935aa4658d92526279c7a102 | [
"MIT"
] | null | null | null | import collections
import logging
import time
from functools import partial
from typing import Union, Iterable, Callable
import numbers
import numpy as np
from qcodes import Instrument, IPInstrument, InstrumentChannel
from qcodes.utils.deprecate import deprecate
from qcodes.math_utils.field_vector import FieldVector
... | 36.568182 | 79 | 0.544576 |
794078f6921994f0252f7b2a7280cb1d9e65d0be | 3,197 | py | Python | Solution_File_D-Getting_SASPy_Environment_Info.py | ilankham/wuss-2019-half-day-class | 7b872e5ee294e62c62a20c5cd7b4e441df63f70a | [
"MIT"
] | 2 | 2019-09-04T03:29:12.000Z | 2021-03-02T07:22:08.000Z | Solution_File_D-Getting_SASPy_Environment_Info.py | ilankham/wuss-2019-half-day-class | 7b872e5ee294e62c62a20c5cd7b4e441df63f70a | [
"MIT"
] | null | null | null | Solution_File_D-Getting_SASPy_Environment_Info.py | ilankham/wuss-2019-half-day-class | 7b872e5ee294e62c62a20c5cd7b4e441df63f70a | [
"MIT"
] | 3 | 2019-09-04T05:57:02.000Z | 2019-09-15T21:21:47.000Z | # Everything is better with friends: Executing SAS® code in Python scripts with
# SASPy, and turbocharging your SAS programming with open-source tooling
#
# Half-day class, Western Users of SAS Software (WUSS) 2019
###############################################################################
# Exercise 10: Getting ... | 42.065789 | 79 | 0.59681 |
7940b1f21f13a2395d436196b9a0d8fe4901563e | 1,384 | py | Python | superset/migrations/versions/1a48a5411020_adding_slug_to_dash.py | franksam007/incubator-superset | a0f572eb3ea4b89cb435a8af20436f8e1d34814e | [
"Apache-2.0"
] | 108 | 2018-01-22T11:09:59.000Z | 2021-01-15T10:53:04.000Z | superset/migrations/versions/1a48a5411020_adding_slug_to_dash.py | franksam007/incubator-superset | a0f572eb3ea4b89cb435a8af20436f8e1d34814e | [
"Apache-2.0"
] | 112 | 2018-01-25T22:57:21.000Z | 2019-08-22T20:08:48.000Z | superset/migrations/versions/1a48a5411020_adding_slug_to_dash.py | zhwXF/Superset | 14c3488c79f8f3cdbd1123e8f7a92f8746c2db09 | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 24 | 2018-01-19T22:54:39.000Z | 2020-11-12T13:04:25.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 32.186047 | 88 | 0.74422 |
7940d69df3fbe72f3f545c1df20a26c1b2095d9a | 2,964 | py | Python | stackformation/deploy/__init__.py | ibejohn818/stackformation | 7ab5b29b584c64cea31add470c4f6df847d19c1c | [
"MIT"
] | null | null | null | stackformation/deploy/__init__.py | ibejohn818/stackformation | 7ab5b29b584c64cea31add470c4f6df847d19c1c | [
"MIT"
] | 1,396 | 2017-12-24T18:25:05.000Z | 2022-03-31T15:05:19.000Z | stackformation/deploy/__init__.py | ibejohn818/stackformation | 7ab5b29b584c64cea31add470c4f6df847d19c1c | [
"MIT"
] | null | null | null | import time
import logging
from stackformation.utils import (match_stack, _match_stack)
from colorama import Fore, Back, Style # noqa
logger = logging.getLogger(__name__)
class Deploy(object):
"""
Base deploy class
"""
def cli_confirm(self, infra, selector=[], **kwargs):
c = 0
... | 26 | 81 | 0.547571 |
79410ef988f942089b54e4f650293b82fb47a886 | 120,069 | py | Python | resources.py | jurjendejong/QGIS3_Delft3D_FM | 058f1ab20974fb0a36e61fe5942e131917d612c7 | [
"MIT"
] | 1 | 2019-10-21T07:42:49.000Z | 2019-10-21T07:42:49.000Z | resources.py | jurjendejong/QGIS3_Delft3D_FM | 058f1ab20974fb0a36e61fe5942e131917d612c7 | [
"MIT"
] | 1 | 2021-09-20T08:42:56.000Z | 2021-09-20T08:42:56.000Z | resources.py | jurjendejong/QGIS3_Delft3D_FM | 058f1ab20974fb0a36e61fe5942e131917d612c7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.13.1)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x18\x0d\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x02\x00\x... | 63.832536 | 129 | 0.726932 |
79413205425ba509658c91258a11ef0bc352c550 | 239 | py | Python | test/mitmproxy/data/addonscripts/stream_modify.py | fedosgad/mitmproxy | 7eacc41f3b1079e000cf6b6c19c0f337d6e01177 | [
"MIT"
] | null | null | null | test/mitmproxy/data/addonscripts/stream_modify.py | fedosgad/mitmproxy | 7eacc41f3b1079e000cf6b6c19c0f337d6e01177 | [
"MIT"
] | null | null | null | test/mitmproxy/data/addonscripts/stream_modify.py | fedosgad/mitmproxy | 7eacc41f3b1079e000cf6b6c19c0f337d6e01177 | [
"MIT"
] | null | null | null | from mitmproxy import ctx
def modify(chunks):
for chunk in chunks:
yield chunk.replace(b"foo", b"bar")
def running():
ctx.log.info("stream_modify running")
def responseheaders(flow):
flow.response.stream = modify
| 15.933333 | 43 | 0.686192 |
79413a76bc7c641286e0e8dcbfbe6a80c043bfa7 | 7,316 | py | Python | mimesis/schema.py | gptubpkCsHKzjC8fKcRXUdK6SbECPM49P5Xu46U/mimesis | 675bd3a8702508c585d808aeb503c4397ada123d | [
"MIT"
] | 1 | 2021-12-21T12:03:54.000Z | 2021-12-21T12:03:54.000Z | mimesis/schema.py | gptubpkCsHKzjC8fKcRXUdK6SbECPM49P5Xu46U/mimesis | 675bd3a8702508c585d808aeb503c4397ada123d | [
"MIT"
] | null | null | null | mimesis/schema.py | gptubpkCsHKzjC8fKcRXUdK6SbECPM49P5Xu46U/mimesis | 675bd3a8702508c585d808aeb503c4397ada123d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Implements classes for generating data by schema."""
import warnings
from typing import Any, Callable, ClassVar, Iterator, List, Optional, Sequence
from mimesis.exceptions import FieldError, SchemaError
from mimesis.locales import Locale
from mimesis.providers.generic import Generic
from mi... | 32.515556 | 95 | 0.585429 |
794179859fd8aa89761fe80b82af930c5d8595e7 | 17,057 | py | Python | image/docker/schema2/list.py | jakedt/quay | 424c1a19d744be444ed27aa1718fd74af311d863 | [
"Apache-2.0"
] | 1 | 2020-10-16T19:30:41.000Z | 2020-10-16T19:30:41.000Z | image/docker/schema2/list.py | jakedt/quay | 424c1a19d744be444ed27aa1718fd74af311d863 | [
"Apache-2.0"
] | 15 | 2020-06-18T15:32:06.000Z | 2022-03-03T23:06:24.000Z | image/docker/schema2/list.py | jakedt/quay | 424c1a19d744be444ed27aa1718fd74af311d863 | [
"Apache-2.0"
] | null | null | null | import logging
import json
from cachetools.func import lru_cache
from jsonschema import validate as validate_schema, ValidationError
from digest import digest_tools
from image.docker import ManifestException
from image.docker.interfaces import ManifestInterface
from image.docker.schema1 import DOCKER_SCHEMA1_MANIFEST... | 38.678005 | 116 | 0.594008 |
79419891b3571a08b249daf88c81de1b891026bc | 4,003 | py | Python | alipay/aop/api/request/AlipayMarketingRecruitEnrollCreateRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayMarketingRecruitEnrollCreateRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayMarketingRecruitEnrollCreateRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayMarketingRecruitEnrollCreateModel import AlipayMarketingRecruitEnrollCreateModel
class AlipayMarketingRecruitEnrollCreateReque... | 27.606897 | 148 | 0.647514 |
7941c1f3859c4e7787c50eb7657d338c31cfbb8d | 7,433 | py | Python | bugzoo/mgr/build.py | pdreiter/BugZoo | e164ee67ff8bd3addfcc87b5e38ff1774992196b | [
"MIT"
] | 53 | 2017-12-02T03:22:06.000Z | 2022-03-10T22:20:52.000Z | bugzoo/mgr/build.py | pdreiter/BugZoo | e164ee67ff8bd3addfcc87b5e38ff1774992196b | [
"MIT"
] | 145 | 2017-11-29T23:23:06.000Z | 2020-09-17T22:17:44.000Z | bugzoo/mgr/build.py | pdreiter/BugZoo | e164ee67ff8bd3addfcc87b5e38ff1774992196b | [
"MIT"
] | 8 | 2018-06-26T17:58:49.000Z | 2021-09-07T14:03:41.000Z | from typing import Iterator
import os
import shutil
import json
import logging
import docker
from ..core.build import BuildInstructions
from ..exceptions import ImageBuildFailed
logger = logging.getLogger(__name__) # type: logging.Logger
logger.setLevel(logging.DEBUG)
class BuildManager(object):
def __init__(... | 34.09633 | 80 | 0.532625 |
7941d31624033994a517c40e2ab0ec5b9de9c537 | 15,881 | py | Python | app/enquiries/tests/test_auth.py | uktrade/enquiry-mgmt-tool | 547a195cb9296ad0b1dbc5c8435bfeeae9755bb4 | [
"MIT"
] | 3 | 2020-04-03T12:16:56.000Z | 2020-12-09T18:18:49.000Z | app/enquiries/tests/test_auth.py | uktrade/enquiry-mgmt-tool | 547a195cb9296ad0b1dbc5c8435bfeeae9755bb4 | [
"MIT"
] | 173 | 2020-03-18T09:31:50.000Z | 2022-03-26T04:19:41.000Z | app/enquiries/tests/test_auth.py | uktrade/enquiry-mgmt-tool | 547a195cb9296ad0b1dbc5c8435bfeeae9755bb4 | [
"MIT"
] | null | null | null | import datetime
from collections.abc import Mapping, Sequence
import mohawk
import pytest
from django.urls import reverse, path
from freezegun import freeze_time
from rest_framework import status
from rest_framework.response import Response
from rest_framework.test import APIRequestFactory
from rest_framework.views im... | 34.300216 | 99 | 0.607707 |
7941d915b6363ecbdf98bde2599ec77ea5305f91 | 343 | py | Python | 0x04-python-more_data_structures/102-complex_delete.py | oluwaseun-ebenezer/holbertonschool-higher_level_programming | e830f969d3ca71abf0a2f6d4f7c64a82337eccd7 | [
"MIT"
] | null | null | null | 0x04-python-more_data_structures/102-complex_delete.py | oluwaseun-ebenezer/holbertonschool-higher_level_programming | e830f969d3ca71abf0a2f6d4f7c64a82337eccd7 | [
"MIT"
] | null | null | null | 0x04-python-more_data_structures/102-complex_delete.py | oluwaseun-ebenezer/holbertonschool-higher_level_programming | e830f969d3ca71abf0a2f6d4f7c64a82337eccd7 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# 102-complex_delete.py
def complex_delete(a_dictionary, value):
"""Delete keys with a specific value in a dictionary."""
while value in a_dictionary.values():
for k, v in a_dictionary.items():
if v == value:
del a_dictionary[k]
break
... | 24.5 | 60 | 0.606414 |
7941ec507bc59e002087d8508825b95e65385c1f | 14,927 | py | Python | volttrontesting/platform/dbutils/test_influxdbutils.py | architpansare/volttron | ea8e7b3c8af9ce08dc736bd8a5c7b513d6b94fe9 | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | volttrontesting/platform/dbutils/test_influxdbutils.py | architpansare/volttron | ea8e7b3c8af9ce08dc736bd8a5c7b513d6b94fe9 | [
"Apache-2.0",
"BSD-2-Clause"
] | 4 | 2021-05-28T19:12:54.000Z | 2022-02-18T03:07:40.000Z | volttrontesting/platform/dbutils/test_influxdbutils.py | architpansare/volttron | ea8e7b3c8af9ce08dc736bd8a5c7b513d6b94fe9 | [
"Apache-2.0",
"BSD-2-Clause"
] | 3 | 2021-06-12T19:49:56.000Z | 2022-02-12T20:14:38.000Z | from time import time
import os
from gevent import sleep
import pytest
try:
from influxdb import InfluxDBClient
except ImportError:
pytest.skip(
"Required imports for testing are not installed; thus, not running tests. "
"If on Ubuntu or Debian OS, install imports with: services/core/InfluxdbHi... | 29.21135 | 126 | 0.521337 |
79424548d33de4aa405f63c3a67ad80562f4d292 | 158 | py | Python | pistis/__init__.py | mbhall88/metis | 8c5e5834f053f276ae937cde4e28b82fe8e1611e | [
"MIT"
] | 6 | 2018-08-27T15:18:54.000Z | 2021-07-17T04:17:20.000Z | pistis/__init__.py | mbhall88/metis | 8c5e5834f053f276ae937cde4e28b82fe8e1611e | [
"MIT"
] | 1 | 2018-04-17T21:33:34.000Z | 2018-04-19T12:50:19.000Z | pistis/__init__.py | mbhall88/pistis | 8c5e5834f053f276ae937cde4e28b82fe8e1611e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Top-level package for pistis."""
__author__ = """Michael Benjamin Hall"""
__email__ = 'mbhall88@gmail.com'
__version__ = '0.1.0'
| 19.75 | 40 | 0.64557 |
79425c0a7e0ac0fbc71bf38112a35bf8c87242ae | 10,377 | py | Python | src/local/butler/py_unittest.py | fengjixuchui/clusterfuzz | ef89be3934936d1086b4a21bffca5506c8cb93be | [
"Apache-2.0"
] | null | null | null | src/local/butler/py_unittest.py | fengjixuchui/clusterfuzz | ef89be3934936d1086b4a21bffca5506c8cb93be | [
"Apache-2.0"
] | null | null | null | src/local/butler/py_unittest.py | fengjixuchui/clusterfuzz | ef89be3934936d1086b4a21bffca5506c8cb93be | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 32.735016 | 80 | 0.722078 |
794263de5d51313dcc44eb9c8469f00dbf079907 | 4,242 | py | Python | src/emotion/utils/file_reading.py | Thanatoz-1/EmotionStimuli | f7774cf77ec2a66949949905ed70d62117179666 | [
"BSD-3-Clause"
] | null | null | null | src/emotion/utils/file_reading.py | Thanatoz-1/EmotionStimuli | f7774cf77ec2a66949949905ed70d62117179666 | [
"BSD-3-Clause"
] | 2 | 2021-07-28T10:38:03.000Z | 2021-07-31T10:37:09.000Z | src/emotion/utils/file_reading.py | Thanatoz-1/EmotionStimuli | f7774cf77ec2a66949949905ed70d62117179666 | [
"BSD-3-Clause"
] | null | null | null | __author__ = "Maximilian Wegge"
import random, json, copy
class Data:
"""The Data object stores the unaltered data from a file
and performs preprocessing steps such as splitting into
subsets and converting the annotations' format.
"""
def __init__(
self,
filename: str,
ro... | 36.568966 | 91 | 0.537011 |
79429652637da9b9db83beddfed720442abd0280 | 4,541 | py | Python | lib/prairie.py | JLSirvent/bws-calibration-analysis | b2f129e31974c16d7498e105a075b43bfece92c9 | [
"MIT"
] | null | null | null | lib/prairie.py | JLSirvent/bws-calibration-analysis | b2f129e31974c16d7498e105a075b43bfece92c9 | [
"MIT"
] | null | null | null | lib/prairie.py | JLSirvent/bws-calibration-analysis | b2f129e31974c16d7498e105a075b43bfece92c9 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------
# Copyright (c) <2017> <Lionel Garcia>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restrictio... | 35.755906 | 136 | 0.603612 |
79429e5d78d7585785060aee96bc86d8d5629e84 | 8,606 | py | Python | util/DataBank.py | F-Stuckmann/PATARA | 26b5c821e356e33e949817a1475ef38e75880a03 | [
"MIT"
] | 2 | 2021-11-04T06:48:45.000Z | 2022-01-19T16:25:20.000Z | util/DataBank.py | F-Stuckmann/PATARA | 26b5c821e356e33e949817a1475ef38e75880a03 | [
"MIT"
] | 1 | 2021-05-05T09:05:22.000Z | 2021-05-05T09:05:22.000Z | util/DataBank.py | F-Stuckmann/PATARA | 26b5c821e356e33e949817a1475ef38e75880a03 | [
"MIT"
] | 2 | 2021-05-05T08:42:57.000Z | 2021-11-04T06:48:49.000Z | import copy
import csv
import os, glob
from typing import List
import xmltodict
import Constants
from Constants import *
from util.Instruction import Instruction
from util.Processor import Processor
from util.TestInstruction import TestInstruction
class DataBank:
class __Databank:
def __init__(self):
... | 38.591928 | 152 | 0.570067 |
794350cf9d817a15e613d3b55766524c044ac97a | 23,725 | py | Python | pypika/tests/test_functions.py | foggel/pypika | 1f6ab34bada982fe632e5828f87bfbac2e601c5f | [
"Apache-2.0"
] | null | null | null | pypika/tests/test_functions.py | foggel/pypika | 1f6ab34bada982fe632e5828f87bfbac2e601c5f | [
"Apache-2.0"
] | null | null | null | pypika/tests/test_functions.py | foggel/pypika | 1f6ab34bada982fe632e5828f87bfbac2e601c5f | [
"Apache-2.0"
] | null | null | null | import unittest
from pypika import (
Case,
CaseException,
DatePart,
Field as F,
Query,
Query as Q,
Schema,
Table as T,
VerticaQuery,
functions as fn,
)
from pypika.enums import Dialects, SqlTypes
__author__ = "Timothy Heys"
__email__ = "theys@kayak.com"
class FunctionTests(un... | 34.78739 | 104 | 0.598736 |
7943677c73c476ae1a7ddf1ee604277dd5599bcb | 3,624 | py | Python | salt/utils/mako.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | 2 | 2017-09-17T21:10:35.000Z | 2019-08-26T03:00:12.000Z | salt/utils/mako.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | salt/utils/mako.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | 3 | 2021-02-23T08:12:48.000Z | 2021-02-23T08:13:13.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
# Import python libs
import os
import urlparse
# Import third party libs
from mako.lookup import TemplateCollection, TemplateLookup
# Import salt libs
import salt.fileclient
class SaltMakoTemplateLookup(TemplateCollection):
"""
Look up Mako tem... | 37.75 | 99 | 0.549945 |
79437956e5607d5e0a159baa5ff8342e2b0ed99c | 2,283 | py | Python | server1/models/__init__.py | cchangr/Animal | f6701c9780dc06a3420bcec8664b3b89ed67174f | [
"MIT"
] | null | null | null | server1/models/__init__.py | cchangr/Animal | f6701c9780dc06a3420bcec8664b3b89ed67174f | [
"MIT"
] | null | null | null | server1/models/__init__.py | cchangr/Animal | f6701c9780dc06a3420bcec8664b3b89ed67174f | [
"MIT"
] | null | null | null | import json
from server1.utils import log
def save(data, path):
s = json.dumps(data, indent=2, ensure_ascii=False)
with open(path, 'w+', encoding='utf-8') as f:
log('save', path, s, data)
f.write(s)
def load(path):
with open(path, 'r', encoding='utf-8') as f:
s = f.read()
... | 24.815217 | 80 | 0.473062 |
794397f22334c4db124c0decc963f5fbb527abf7 | 1,613 | py | Python | msdsl/expr/extras.py | sgherbst/msdsl | e38d5ecdb88b3574bda62f22a4f91ce3e4173d12 | [
"MIT"
] | 15 | 2019-05-14T10:12:23.000Z | 2022-03-29T15:29:52.000Z | msdsl/expr/extras.py | sgherbst/msdsl | e38d5ecdb88b3574bda62f22a4f91ce3e4173d12 | [
"MIT"
] | 19 | 2020-01-22T21:44:33.000Z | 2021-06-05T02:10:41.000Z | msdsl/expr/extras.py | sgherbst/msdsl | e38d5ecdb88b3574bda62f22a4f91ce3e4173d12 | [
"MIT"
] | 5 | 2019-10-21T09:53:17.000Z | 2021-08-10T17:32:20.000Z | from typing import Union, List
from numbers import Number, Integral
from msdsl.expr.expr import ModelExpr, concatenate, BitwiseAnd, array
def all_between(x: List[ModelExpr], lo: Union[Number, ModelExpr], hi: Union[Number, ModelExpr]) -> ModelExpr:
"""
Limit checking. Check if a list of ModelExpr objects ... | 40.325 | 122 | 0.655301 |
7943e3313fc8d6a8742f2f6043fdc63a65d3cad9 | 2,812 | py | Python | astore.py | anton-muravev/ased | 16ddb70ac3e46556cf49569915df0165a6fb7d16 | [
"Apache-2.0"
] | null | null | null | astore.py | anton-muravev/ased | 16ddb70ac3e46556cf49569915df0165a6fb7d16 | [
"Apache-2.0"
] | null | null | null | astore.py | anton-muravev/ased | 16ddb70ac3e46556cf49569915df0165a6fb7d16 | [
"Apache-2.0"
] | 1 | 2021-12-06T08:42:59.000Z | 2021-12-06T08:42:59.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pickle
from collections.abc import MutableMapping
class Astore(MutableMapping):
"""Class to store the data arrays. Extends the standard dictionary,
but offers additional file operations.
Needs to be initialized before use."""
def __init__... | 28.989691 | 78 | 0.54303 |
7943f23f7aefc7fd50cdb8b5739084d25b2fc8e9 | 1,141 | py | Python | get_power.py | FraserTooth/echonet_interface | e009a6371543a65ac8c5ed895e7258fb072612f8 | [
"MIT"
] | 1 | 2021-09-22T10:25:32.000Z | 2021-09-22T10:25:32.000Z | get_power.py | FraserTooth/echonet_interface | e009a6371543a65ac8c5ed895e7258fb072612f8 | [
"MIT"
] | null | null | null | get_power.py | FraserTooth/echonet_interface | e009a6371543a65ac8c5ed895e7258fb072612f8 | [
"MIT"
] | null | null | null | import meter.echonet as echonet
from meter.common import byte2str, hex2int
import meter.b_route as b_route
from meter.serial_connection import connect_to_serial_port
import time
import logging.handlers
import meter.influx as db
# ロガー取得
logger = logging.getLogger("main")
fmt = "%(asctime)s %(levelname)s %(name)s :%(me... | 25.931818 | 59 | 0.683611 |
794434db109bea45a8765a6f4f0175ce4fade3af | 877 | py | Python | sdks/python/test/test_ErrorCounts.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/test/test_ErrorCounts.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/test/test_ErrorCounts.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
from __future__ import absolute_import
import unittest
import appcente... | 21.925 | 81 | 0.703535 |
7944497bc29382263c0a5459b7f81f8c2e732d9a | 12,156 | py | Python | pollination_sdk/models/step_array_input.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | 2 | 2020-01-30T23:28:59.000Z | 2020-05-06T16:43:47.000Z | pollination_sdk/models/step_array_input.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | 1 | 2020-10-02T18:00:25.000Z | 2020-10-02T18:00:25.000Z | pollination_sdk/models/step_array_input.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | null | null | null | # coding: utf-8
"""
pollination-server
Pollination Server OpenAPI Definition # noqa: E501
The version of the OpenAPI document: 0.16.0
Contact: info@pollination.cloud
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from pollination_sdk.configu... | 32.244032 | 243 | 0.620105 |
79444a3621cf0bd4a7c2b6f8b9e3c8987946d001 | 960 | py | Python | More/E02_Flat/_RunAll.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 5 | 2020-06-20T22:01:23.000Z | 2021-08-06T04:39:50.000Z | More/E02_Flat/_RunAll.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 5 | 2020-05-17T09:32:27.000Z | 2021-03-15T19:45:52.000Z | More/E02_Flat/_RunAll.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 2 | 2021-02-25T19:07:45.000Z | 2022-01-09T21:14:06.000Z | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T E X A M P L E S
#
# Copyright (c) 2017 Thom Janssen <https://github.com/thomgb>
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, w... | 26.666667 | 80 | 0.623958 |
79444dc9facbd23bc3bdf176ffcc0fca9ebcb6c1 | 22,998 | py | Python | examples/tough_heat/tough.py | jonghyunharrylee/PCGA | ed1b46f33847eafde685c97ef28d473baf63cf2f | [
"BSD-3-Clause"
] | 16 | 2018-09-09T11:27:20.000Z | 2022-03-09T01:46:37.000Z | examples/tough_heat/tough.py | jonghyunharrylee/PCGA | ed1b46f33847eafde685c97ef28d473baf63cf2f | [
"BSD-3-Clause"
] | 8 | 2018-03-19T19:36:38.000Z | 2022-01-26T20:09:27.000Z | examples/tough_heat/tough.py | jonghyunharrylee/PCGA | ed1b46f33847eafde685c97ef28d473baf63cf2f | [
"BSD-3-Clause"
] | 12 | 2018-06-29T13:16:40.000Z | 2022-03-09T01:46:25.000Z | import matplotlib
#matplotlib.use('Agg')
import math
import os
import pandas as pd
import matplotlib.pyplot as plt
import sys
import pandas as pd
# PyTOUGH specific modules
from mulgrids import *
from t2thermo import *
from t2data import *
from t2incons import *
from os import system
import scipy.io a... | 39.447684 | 155 | 0.551744 |
79445ce81fbd835aa2945a37aaadb7b752c4e27d | 1,999 | py | Python | lab2/text_recognizer/data/mnist.py | wook3024/fsdl-text-recognizer-2021-labs | 06ccc875eaa22971a9c3e78785566739ec75702a | [
"MIT"
] | null | null | null | lab2/text_recognizer/data/mnist.py | wook3024/fsdl-text-recognizer-2021-labs | 06ccc875eaa22971a9c3e78785566739ec75702a | [
"MIT"
] | null | null | null | lab2/text_recognizer/data/mnist.py | wook3024/fsdl-text-recognizer-2021-labs | 06ccc875eaa22971a9c3e78785566739ec75702a | [
"MIT"
] | null | null | null | """MNIST DataModule"""
import argparse
from torch.utils.data import random_split
from torchvision.datasets import MNIST as TorchMNIST
from torchvision import transforms
from text_recognizer.data.base_data_module import BaseDataModule, load_and_print_info
DOWNLOADED_DATA_DIRNAME = BaseDataModule.data_dirname() / "dow... | 34.465517 | 96 | 0.68084 |
79449bb6d4b783cd527d7f6b0f7c4d33938b970e | 21,034 | py | Python | onmt/inference/fast_translator.py | jniehues-kit/NMTGMinor | 7631ce9c4f19fc7d0ebf475860fa60e681847969 | [
"MIT"
] | 1 | 2019-09-11T10:09:37.000Z | 2019-09-11T10:09:37.000Z | onmt/inference/fast_translator.py | jniehues-kit/NMTGMinor | 7631ce9c4f19fc7d0ebf475860fa60e681847969 | [
"MIT"
] | null | null | null | onmt/inference/fast_translator.py | jniehues-kit/NMTGMinor | 7631ce9c4f19fc7d0ebf475860fa60e681847969 | [
"MIT"
] | 1 | 2019-09-15T17:22:58.000Z | 2019-09-15T17:22:58.000Z | import onmt
import onmt.modules
import torch.nn as nn
import torch
import math
from torch.autograd import Variable
from onmt.model_factory import build_model
import torch.nn.functional as F
from onmt.inference.search import BeamSearch, DiverseBeamSearch
from onmt.inference.translator import Translator
model_list = ['t... | 41.817097 | 119 | 0.563374 |
7944a0b247702254da4e3d2f2b219e6fdf9d75c6 | 6,790 | py | Python | src/graph_transpiler/webdnn/optimizer/sub_rules/elementwise_kernel_fusion.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | 1 | 2018-07-26T13:52:21.000Z | 2018-07-26T13:52:21.000Z | src/graph_transpiler/webdnn/optimizer/sub_rules/elementwise_kernel_fusion.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | null | null | null | src/graph_transpiler/webdnn/optimizer/sub_rules/elementwise_kernel_fusion.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | null | null | null | from typing import Tuple, List
from webdnn.graph import traverse
from webdnn.graph.graph import Graph
from webdnn.graph.operators.elementwise import Elementwise
from webdnn.graph.operators.fused_elementwise import FusedElementwise
from webdnn.graph.optimize_rule import OptimizeRule
from webdnn.util import flags
def ... | 39.022989 | 135 | 0.493225 |
7944b557bbf1ee69d4b4e2050cce201e85ec49c3 | 3,014 | py | Python | brca_exchange_cooccurrence_analysis/extract_roh_region_distributions.plot.py | glennhickey/CharlieSandbox | 2949f8357433a6219abf192f899ab50e2c8edaba | [
"MIT"
] | null | null | null | brca_exchange_cooccurrence_analysis/extract_roh_region_distributions.plot.py | glennhickey/CharlieSandbox | 2949f8357433a6219abf192f899ab50e2c8edaba | [
"MIT"
] | null | null | null | brca_exchange_cooccurrence_analysis/extract_roh_region_distributions.plot.py | glennhickey/CharlieSandbox | 2949f8357433a6219abf192f899ab50e2c8edaba | [
"MIT"
] | 1 | 2021-08-03T17:23:47.000Z | 2021-08-03T17:23:47.000Z | import matplotlib
matplotlib.use('Agg')
import vcf, argparse, sys
import numpy as np
import pandas as pd
import math
from scipy.stats import chisquare
from collections import defaultdict
import matplotlib
matplotlib.use('Agg')
import vcf, argparse, sys
import numpy as np
import pandas as pd
import math
import seaborn a... | 39.657895 | 161 | 0.663238 |
7944e0d321aec95ec1a4233974001415dd8cc2d2 | 4,449 | py | Python | sapp/ui/filter_predicates.py | facebook/sapp | 4b85d10a791d8e9c8ae83d1f62fbded24845f053 | [
"MIT"
] | 74 | 2020-12-18T20:04:30.000Z | 2022-03-22T22:26:02.000Z | sapp/ui/filter_predicates.py | facebook/sapp | 4b85d10a791d8e9c8ae83d1f62fbded24845f053 | [
"MIT"
] | 61 | 2020-12-21T21:33:05.000Z | 2022-01-27T21:22:20.000Z | sapp/ui/filter_predicates.py | facebook/sapp | 4b85d10a791d8e9c8ae83d1f62fbded24845f053 | [
"MIT"
] | 20 | 2021-04-08T01:28:53.000Z | 2022-03-22T22:26:05.000Z | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import annotations
import re
from abc import ABC, abstractmethod
from typing import (
TYPE_CHECKING,
Generic,
L... | 28.703226 | 87 | 0.646662 |
79450d109d75327a1c617c572fbbba3b61d7b12b | 21,241 | py | Python | tests/test_config.py | melexis/warnings-plugin | 6f821f5c82c2cdf37988d28e651646e1452faf43 | [
"Apache-2.0"
] | 7 | 2017-04-21T12:05:23.000Z | 2019-12-12T13:37:07.000Z | tests/test_config.py | melexis/warnings-plugin | 6f821f5c82c2cdf37988d28e651646e1452faf43 | [
"Apache-2.0"
] | 100 | 2017-04-24T10:50:33.000Z | 2022-02-18T10:39:42.000Z | tests/test_config.py | melexis/warnings-plugin | 6f821f5c82c2cdf37988d28e651646e1452faf43 | [
"Apache-2.0"
] | 2 | 2017-05-23T11:50:59.000Z | 2019-11-06T09:26:33.000Z | from io import StringIO
from unittest import TestCase
from unittest.mock import patch
from mlx.junit_checker import JUnitChecker
from mlx.regex_checker import DoxyChecker, SphinxChecker, XMLRunnerChecker
from mlx.robot_checker import RobotChecker
from mlx.warnings import WarningsPlugin
class TestConfig(TestCase):
... | 40.001883 | 160 | 0.543195 |
794532923fb7491591d8157e69d39950293a8ac4 | 689 | py | Python | antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/series/series.py | AntaresSimulatorTeam/antaREST | d686d2a86a52737c211ae67f3cee591f559909f2 | [
"Apache-2.0"
] | 2 | 2020-09-30T11:40:22.000Z | 2020-11-09T09:06:30.000Z | antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/series/series.py | AntaresSimulatorTeam/antaREST | d686d2a86a52737c211ae67f3cee591f559909f2 | [
"Apache-2.0"
] | 542 | 2021-01-11T13:23:47.000Z | 2022-03-31T15:38:10.000Z | antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/series/series.py | AntaresSimulatorTeam/antaREST | d686d2a86a52737c211ae67f3cee591f559909f2 | [
"Apache-2.0"
] | 1 | 2020-10-01T12:18:15.000Z | 2020-10-01T12:18:15.000Z | from antarest.study.storage.rawstudy.model.filesystem.config.model import (
FileStudyTreeConfig,
)
from antarest.study.storage.rawstudy.model.filesystem.folder_node import (
FolderNode,
)
from antarest.study.storage.rawstudy.model.filesystem.inode import TREE
from antarest.study.storage.rawstudy.model.filesyste... | 31.318182 | 98 | 0.702467 |
79455ba8d7027cf84131d0e0e9714af51335d990 | 16,511 | py | Python | courses/modsim2018/tasks/Tasks_DuringLecture18/BMC-master/functions/io_cortexmac.py | raissabthibes/bmc | 840800fb94ea3bf188847d0771ca7197dfec68e3 | [
"MIT"
] | null | null | null | courses/modsim2018/tasks/Tasks_DuringLecture18/BMC-master/functions/io_cortexmac.py | raissabthibes/bmc | 840800fb94ea3bf188847d0771ca7197dfec68e3 | [
"MIT"
] | null | null | null | courses/modsim2018/tasks/Tasks_DuringLecture18/BMC-master/functions/io_cortexmac.py | raissabthibes/bmc | 840800fb94ea3bf188847d0771ca7197dfec68e3 | [
"MIT"
] | null | null | null | """Read and write Cortex Motion Analysis Corporation ASCII related files.
read_trc(fname, fname2='_2', units='', df_multi=True): Read .trc file.
read_anc(fname): Read .anc file.
read_cal(fname): Read .cal file.
read_forces(fname): Read .forces file.
write_trc(fname, header, df): Write .trc file.
... | 38.13164 | 98 | 0.586034 |
7945632d2ba7e7a49ada01d7671f239ba0ff6710 | 809 | py | Python | register/widgets.py | Xowap/Maiznet | bd564d4c93eb28dc87135e9d31dad9a921ea8cf6 | [
"WTFPL"
] | 1 | 2015-05-04T09:28:14.000Z | 2015-05-04T09:28:14.000Z | register/widgets.py | Xowap/Maiznet | bd564d4c93eb28dc87135e9d31dad9a921ea8cf6 | [
"WTFPL"
] | null | null | null | register/widgets.py | Xowap/Maiznet | bd564d4c93eb28dc87135e9d31dad9a921ea8cf6 | [
"WTFPL"
] | null | null | null | ########################################################################
# vim: fileencoding=utf-8 ts=8 noexpandtab :
#
# ~~~~ Maiznet.fr ~~~~
#
# -> register/widgets.py
#
#
# Copyright 2011 Rémy Sanchez <remy.sanchez@hyperthese.net>
#
# This file is distributed under the terms of the WTFPL. For more
# informations, s... | 23.794118 | 72 | 0.555006 |
794567015bbbf6a8fe8438be68b19430a479750f | 2,229 | py | Python | hashTable/containsDuplicateII.py | Jiganesh/High-On-DSA | 044a3941cec443a87e79d97962551d75a9639a57 | [
"MIT"
] | 76 | 2021-12-12T08:42:20.000Z | 2022-03-31T19:48:46.000Z | hashTable/containsDuplicateII.py | Jiganesh/High-On-DSA | 044a3941cec443a87e79d97962551d75a9639a57 | [
"MIT"
] | 4 | 2022-01-04T09:58:39.000Z | 2022-03-30T17:00:39.000Z | hashTable/containsDuplicateII.py | Jiganesh/High-On-DSA | 044a3941cec443a87e79d97962551d75a9639a57 | [
"MIT"
] | 13 | 2021-12-12T14:44:41.000Z | 2022-03-10T14:08:20.000Z | # https://leetcode.com/problems/contains-duplicate-ii/
class Solution:
# Runtime: 720 ms, faster than 65.63% of Python3 online submissions for Contains Duplicate II.
# Memory Usage: 32.1 MB, less than 9.33% of Python3 online submissions for Contains Duplicate II.
def containsNearbyDuplicate(self,... | 33.268657 | 102 | 0.536563 |
7945ae60abfea11a4ac1f97c7538d3c901276a50 | 1,931 | py | Python | api/python/log_book_post_encoder.py | AndreyShamis/lbook | ab5b01966dc8b279ab850d0e579203c15da0c360 | [
"MIT"
] | 2 | 2018-03-10T08:08:03.000Z | 2020-11-30T17:10:43.000Z | api/python/log_book_post_encoder.py | AndreyShamis/lbook | ab5b01966dc8b279ab850d0e579203c15da0c360 | [
"MIT"
] | 10 | 2018-03-04T06:51:42.000Z | 2022-03-14T15:12:52.000Z | api/python/log_book_post_encoder.py | AndreyShamis/lbook | ab5b01966dc8b279ab850d0e579203c15da0c360 | [
"MIT"
] | null | null | null | import sys
import uuid
import codecs
import io
import mimetypes
class LogBookPostEncoder:
def __init__(self):
self.frontier = uuid.uuid4().hex
self.content_type = f'multipart/form-data; boundary={self.frontier}'
def encode(self, fields: list, files: list):
tmp_body = io.BytesIO()
... | 37.862745 | 120 | 0.605904 |
7945ba09a5b6713f91a2d3c20bc815a55e0213ed | 18,846 | py | Python | leo/plugins/xsltWithNodes.py | frakel/leo-editor | b574118ee3b7ffe8344fa0d00dac603096117ac7 | [
"MIT"
] | null | null | null | leo/plugins/xsltWithNodes.py | frakel/leo-editor | b574118ee3b7ffe8344fa0d00dac603096117ac7 | [
"MIT"
] | null | null | null | leo/plugins/xsltWithNodes.py | frakel/leo-editor | b574118ee3b7ffe8344fa0d00dac603096117ac7 | [
"MIT"
] | null | null | null | #@+leo-ver=5-thin
#@+node:mork.20041010095009: * @file xsltWithNodes.py
#@+<< docstring >>
#@+node:ekr.20050226120104: ** << docstring >>
""" Adds the Outline:XSLT menu containing XSLT-related commands.
This menu contains the following items:
- Set StyleSheet Node:
- Selects the current node as the xsl stylesheet... | 30.945813 | 100 | 0.586225 |
7945bd9d5b4bf0ebd8eae9ef8901a7fe482c987a | 1,293 | py | Python | Problem_sets/spiral_matrix/test_script/test.py | zanderhinton/DSA_collaborative_prep | 8427255e0084c6d69031027492d847a90b970840 | [
"MIT"
] | 3 | 2020-02-02T14:52:16.000Z | 2020-09-28T12:32:35.000Z | Problem_sets/spiral_matrix/test_script/test.py | zanderhinton/DSA_collaborative_prep | 8427255e0084c6d69031027492d847a90b970840 | [
"MIT"
] | 14 | 2020-02-02T21:17:49.000Z | 2020-02-10T15:48:36.000Z | Problem_sets/spiral_matrix/test_script/test.py | zanderhinton/DSA_collaborative_prep | 8427255e0084c6d69031027492d847a90b970840 | [
"MIT"
] | 9 | 2020-02-02T20:00:05.000Z | 2020-02-17T19:02:32.000Z | import time
import numpy as np
from test_script.solution import spiral_matrix
test_cases = [1, 2, 3, 4, 5] #insert test case objects into a list eg [test-case-1, test-case-2, test-case-3]
loops = 10 # loops to be taken for calculating average time, for complex problems, lower this value.
def test_spiral_matrix(user_fu... | 36.942857 | 109 | 0.614076 |
7945cba57dd076965b718874a6cfc33d41b5cb60 | 1,589 | py | Python | sample/basic/basic_file_report_example.py | ndcolter-mcafee/opendxl-virustotal-service-python | c65515d9b9c91bca08d5024c27b593ee07a22f92 | [
"Apache-2.0"
] | 6 | 2017-05-04T18:42:44.000Z | 2021-03-23T13:46:03.000Z | sample/basic/basic_file_report_example.py | ndcolter-mcafee/opendxl-virustotal-service-python | c65515d9b9c91bca08d5024c27b593ee07a22f92 | [
"Apache-2.0"
] | 1 | 2018-07-30T17:01:25.000Z | 2018-07-30T20:15:15.000Z | sample/basic/basic_file_report_example.py | ndcolter-mcafee/opendxl-virustotal-service-python | c65515d9b9c91bca08d5024c27b593ee07a22f92 | [
"Apache-2.0"
] | 10 | 2017-08-01T00:01:35.000Z | 2019-02-27T21:40:51.000Z | # This sample invokes and displays the results of a VirusTotal "file report" via DXL.
#
# See: https://www.virustotal.com/en/documentation/public-api/#getting-file-scans
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
from dxlclient.client_config import DxlClientConfi... | 33.808511 | 92 | 0.759597 |
7945f307809734f889d5f001bc83bec7615c5ce0 | 4,232 | py | Python | build/lib/gcn/train.py | jindi-tju/MRFasGCN | 41b94278b80bbcb256097a5a3dfb6a433d9dbdc7 | [
"MIT"
] | 2 | 2021-06-20T03:34:09.000Z | 2022-03-24T07:22:56.000Z | build/lib/gcn/train.py | jindi-tju/MRFasGCN | 41b94278b80bbcb256097a5a3dfb6a433d9dbdc7 | [
"MIT"
] | null | null | null | build/lib/gcn/train.py | jindi-tju/MRFasGCN | 41b94278b80bbcb256097a5a3dfb6a433d9dbdc7 | [
"MIT"
] | 1 | 2022-03-17T01:26:07.000Z | 2022-03-17T01:26:07.000Z | from __future__ import division
from __future__ import print_function
import time
import tensorflow as tf
from gcn.utils import *
from gcn.models import GCN, MLP
# Set random seed
seed = 123
np.random.seed(seed)
tf.set_random_seed(seed)
# Settings
flags = tf.app.flags
FLAGS = flags.FLAGS
flags.DEFINE_string('datase... | 36.8 | 106 | 0.708176 |
7945f795d1cfa63d2a5bb3a49f9e203d5cc5494d | 4,693 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_policy_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_policy_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_policy_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 44.273585 | 132 | 0.705732 |
79461cd1730cdb3f451b546c2c6cf7b9f58a8d9f | 854 | py | Python | backend/StaticCodeAnalyzer/urls.py | Compro-Prasad/CAST-static-code-analyzer | a3ab84fa7fdc176960a6c535bb8705cedf92bcad | [
"MIT"
] | null | null | null | backend/StaticCodeAnalyzer/urls.py | Compro-Prasad/CAST-static-code-analyzer | a3ab84fa7fdc176960a6c535bb8705cedf92bcad | [
"MIT"
] | 7 | 2021-06-04T21:52:24.000Z | 2022-02-26T11:33:16.000Z | backend/StaticCodeAnalyzer/urls.py | Compro-Prasad/CAST-static-code-analyzer | a3ab84fa7fdc176960a6c535bb8705cedf92bcad | [
"MIT"
] | null | null | null | """StaticCodeAnalyzer URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
... | 32.846154 | 77 | 0.713115 |
79464283c0c8f4ea4127782d5bdb95dd90d2c02d | 1,821 | py | Python | norms.py | ishine/AFRCNN-For-Speech-Separation | 8be8a33b87c7e294296c141c861f84736982a7c2 | [
"MIT"
] | 108 | 2021-10-06T08:42:48.000Z | 2022-03-28T09:16:14.000Z | norms.py | mtxing/AFRCNN-For-Speech-Separation | 2d2d20e23731279affd797441252e25401451f0d | [
"MIT"
] | 2 | 2022-03-16T09:20:21.000Z | 2022-03-30T12:24:11.000Z | norms.py | mtxing/AFRCNN-For-Speech-Separation | 2d2d20e23731279affd797441252e25401451f0d | [
"MIT"
] | 33 | 2021-10-11T09:00:30.000Z | 2022-03-24T12:15:42.000Z | import torch
import torch.nn as nn
class ChannelWiseLayerNorm(nn.LayerNorm):
"""
Channel wise layer normalization
"""
def __init__(self, *args, **kwargs):
super(ChannelWiseLayerNorm, self).__init__(*args, **kwargs)
def forward(self, x):
"""
x: N x C x T
"""
... | 29.852459 | 74 | 0.572213 |
79466384e0c7d08ce5d10b50403399908ef1a994 | 3,632 | py | Python | tools/studio/cvra_studio/network/ParameterTree.py | greck2908/robot-software | 2e1e8177148a089e8883967375dde7f8ed3d878b | [
"MIT"
] | 40 | 2016-10-04T19:59:22.000Z | 2020-12-25T18:11:35.000Z | tools/studio/cvra_studio/network/ParameterTree.py | greck2908/robot-software | 2e1e8177148a089e8883967375dde7f8ed3d878b | [
"MIT"
] | 209 | 2016-09-21T21:54:28.000Z | 2022-01-26T07:42:37.000Z | tools/studio/cvra_studio/network/ParameterTree.py | greck2908/robot-software | 2e1e8177148a089e8883967375dde7f8ed3d878b | [
"MIT"
] | 21 | 2016-11-07T14:40:16.000Z | 2021-11-02T09:53:37.000Z | from collections import namedtuple
import logging
import queue
import uavcan
_Parameter = namedtuple("Parameter", ["name", "value", "type"])
class Parameter(_Parameter):
def __repr__(self):
return str(self.value)
def value_to_parameter(value, name=""):
if isinstance(value, bool):
return P... | 29.528455 | 83 | 0.60848 |
79467145daba1d832ff132b59b7a6cb22dc1057d | 1,829 | py | Python | giantstar/utils/fileReader.py | DaoSen-v/gaintstar | 5ecae8652c9f71aaa78cc0fd181d431cb130cab1 | [
"MIT"
] | 1 | 2021-08-06T08:32:15.000Z | 2021-08-06T08:32:15.000Z | giantstar/utils/fileReader.py | DaoSen-v/gaintstar | 5ecae8652c9f71aaa78cc0fd181d431cb130cab1 | [
"MIT"
] | null | null | null | giantstar/utils/fileReader.py | DaoSen-v/gaintstar | 5ecae8652c9f71aaa78cc0fd181d431cb130cab1 | [
"MIT"
] | null | null | null | # _*_encoding=utf8_*_
# @Time : 2021/6/10 16:07
# @Author : xuyong
# @Email: yong1.xu@casstime.com
import json
from typing import List
import pymysql
import pandas
from giantstar.globalSetting import plus_setting
from giantstar.utils.error import DatabaseNoSuchData, DataIndexError
class ExcelReader:
files = p... | 29.5 | 112 | 0.642428 |
794673cc4300c071fbbd29a81a8c49c86f2ffa81 | 4,191 | py | Python | nova/objects/instance_fault.py | rossella/nova | 9b1180d5a09227604a470cb9d0790b57daf1b6d7 | [
"Apache-2.0"
] | null | null | null | nova/objects/instance_fault.py | rossella/nova | 9b1180d5a09227604a470cb9d0790b57daf1b6d7 | [
"Apache-2.0"
] | null | null | null | nova/objects/instance_fault.py | rossella/nova | 9b1180d5a09227604a470cb9d0790b57daf1b6d7 | [
"Apache-2.0"
] | 1 | 2020-07-24T06:47:54.000Z | 2020-07-24T06:47:54.000Z | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 37.756757 | 78 | 0.629205 |
7946e6ed355d68d1b718da4578a4d9ae9ff16584 | 458 | py | Python | models/dummynet.py | LendelTheGreat/weak-segmentation | 0ff6015f1af741cfb50ef8fb6f55cea822f68f7a | [
"MIT"
] | 1 | 2020-11-04T03:00:44.000Z | 2020-11-04T03:00:44.000Z | models/dummynet.py | LendelTheGreat/weak-segmentation | 0ff6015f1af741cfb50ef8fb6f55cea822f68f7a | [
"MIT"
] | null | null | null | models/dummynet.py | LendelTheGreat/weak-segmentation | 0ff6015f1af741cfb50ef8fb6f55cea822f68f7a | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
class DummyNet(nn.Module):
def __init__(self):
super(DummyNet, self).__init__()
self.conv1 = nn.Conv2d(3, 10, kernel_size=5, padding=2)
self.conv2 = nn.Conv2d(10, 5, kernel_size=5, padding=2)
self.softmax = nn.Softma... | 26.941176 | 63 | 0.60917 |
7947086a836610c8280f78fa44fe081e98cb729c | 12,826 | py | Python | pontoon/sync/tests/test_core.py | zbraniecki/pontoon | d559316783938bc66d5d9a52dcdb01137475c259 | [
"BSD-3-Clause"
] | 1 | 2017-04-04T06:55:46.000Z | 2017-04-04T06:55:46.000Z | pontoon/sync/tests/test_core.py | zbraniecki/pontoon | d559316783938bc66d5d9a52dcdb01137475c259 | [
"BSD-3-Clause"
] | null | null | null | pontoon/sync/tests/test_core.py | zbraniecki/pontoon | d559316783938bc66d5d9a52dcdb01137475c259 | [
"BSD-3-Clause"
] | null | null | null | import os.path
from django_nose.tools import (
assert_equal,
assert_false,
assert_not_equal,
assert_raises,
assert_true
)
from mock import ANY, Mock, patch, PropertyMock, MagicMock
from pontoon.base.models import (
Entity,
Repository,
Resource,
TranslatedResource,
)
from pontoon.ba... | 39.223242 | 97 | 0.677608 |
794717b6cf3b92d6c4748c894de5e5a27422406e | 1,078 | py | Python | LC/74.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | 2 | 2018-02-24T17:20:02.000Z | 2018-02-24T17:25:43.000Z | LC/74.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | null | null | null | LC/74.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | null | null | null | class Solution(object):
def searchMatrix(self, matrix, target):
"""
:type matrix: List[List[int]]
:type target: int
:rtype: bool
"""
m = len(matrix)
n = len(matrix[0]) if m else 0
if m * n == 0:
return False
if target < matrix[0][0]... | 26.292683 | 60 | 0.396104 |
79471ac969dd0b15dc004a68049eb9673c928b2c | 2,582 | py | Python | river/metrics/fowlkes_mallows.py | online-ml/creme | 60872844e6052b5ef20e4075aea30f9031377136 | [
"BSD-3-Clause"
] | 1,105 | 2019-01-24T15:15:30.000Z | 2020-11-10T18:27:00.000Z | river/metrics/fowlkes_mallows.py | online-ml/creme | 60872844e6052b5ef20e4075aea30f9031377136 | [
"BSD-3-Clause"
] | 328 | 2019-01-25T13:48:43.000Z | 2020-11-11T11:41:44.000Z | river/metrics/fowlkes_mallows.py | online-ml/creme | 60872844e6052b5ef20e4075aea30f9031377136 | [
"BSD-3-Clause"
] | 150 | 2019-01-29T19:05:21.000Z | 2020-11-11T11:50:14.000Z | import math
from river import metrics
__all__ = ["FowlkesMallows"]
class FowlkesMallows(metrics.base.MultiClassMetric):
r"""Fowlkes-Mallows Index.
The Fowlkes-Mallows Index [^1] [^2] is an external evaluation method that is
used to determine the similarity between two clusterings, and also a metric
... | 31.108434 | 103 | 0.647947 |
79472b249a47ce17f0bf199424f6d6172c76bf52 | 6,164 | py | Python | sphinx_gallery/notebook.py | ksunden/sphinx-gallery | 7f26c1a6fc8f53169af2e5fa558d0efbfb32fb4f | [
"BSD-3-Clause"
] | null | null | null | sphinx_gallery/notebook.py | ksunden/sphinx-gallery | 7f26c1a6fc8f53169af2e5fa558d0efbfb32fb4f | [
"BSD-3-Clause"
] | null | null | null | sphinx_gallery/notebook.py | ksunden/sphinx-gallery | 7f26c1a6fc8f53169af2e5fa558d0efbfb32fb4f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
r"""
Parser for Jupyter notebooks
============================
Class that holds the Jupyter notebook information
"""
# Author: Óscar Nájera
# License: 3-clause BSD
from __future__ import division, absolute_import, print_function
from functools import partial
import argparse
import json
import... | 30.666667 | 79 | 0.572193 |
79472c022a4eb58620afb086a13e6cf1fd6b7ca5 | 8,089 | py | Python | calc_metrics.py | maua-maua-maua/nvGAN | edea24c58646780c9fb8ea942e49708ce9d62421 | [
"MIT"
] | null | null | null | calc_metrics.py | maua-maua-maua/nvGAN | edea24c58646780c9fb8ea942e49708ce9d62421 | [
"MIT"
] | null | null | null | calc_metrics.py | maua-maua-maua/nvGAN | edea24c58646780c9fb8ea942e49708ce9d62421 | [
"MIT"
] | null | null | null | # Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this sof... | 43.256684 | 154 | 0.664606 |
794733d7b532de6b215695d5b56304168386af8d | 14,510 | py | Python | lib/python2.7/site-packages/pelican/settings.py | drpaneas/linuxed.gr | 95676e9f18a234092656c61b73b9e6633f2e39ec | [
"MIT"
] | null | null | null | lib/python2.7/site-packages/pelican/settings.py | drpaneas/linuxed.gr | 95676e9f18a234092656c61b73b9e6633f2e39ec | [
"MIT"
] | null | null | null | lib/python2.7/site-packages/pelican/settings.py | drpaneas/linuxed.gr | 95676e9f18a234092656c61b73b9e6633f2e39ec | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import six
import copy
import inspect
import os
import locale
import logging
try:
# SourceFileLoader is the recommended way in 3.3+
from importlib.machinery import SourceFileLoader
load_source = lambda name, path: SourceFileLo... | 37.984293 | 132 | 0.617298 |
794752ad248ac1e49d852f894df16c035754b838 | 294 | py | Python | towers/monkey_village.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | towers/monkey_village.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | towers/monkey_village.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | from tower import Tower
from config import keybinds
class MonkeyVillage(Tower):
name = 'monkey_village'
range = 215
width = 119
height = 103
size = 'xl'
keybind = keybinds[name]
aquatic = False
def __init__(self, **kwargs):
super().__init__(**kwargs)
| 18.375 | 34 | 0.636054 |
79475f3196a3b160a2d27011119ff916db64ee2a | 3,131 | py | Python | alipay/aop/api/response/AlipayTradeCustomsDeclareResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayTradeCustomsDeclareResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayTradeCustomsDeclareResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayTradeCustomsDeclareResponse(AlipayResponse):
def __init__(self):
super(AlipayTradeCustomsDeclareResponse, self).__init__()
self._alipay_declare_no = None
... | 29.537736 | 106 | 0.66145 |
794765247ae3c3418e4dd2a34c55ad54a8d44da3 | 7,861 | py | Python | lib_drl/nets/resnet_v1.py | chang010453/GRP-HAI | 60f7c7633e33dbdd852f5df3e0a3d1017b6b2a22 | [
"MIT"
] | null | null | null | lib_drl/nets/resnet_v1.py | chang010453/GRP-HAI | 60f7c7633e33dbdd852f5df3e0a3d1017b6b2a22 | [
"MIT"
] | null | null | null | lib_drl/nets/resnet_v1.py | chang010453/GRP-HAI | 60f7c7633e33dbdd852f5df3e0a3d1017b6b2a22 | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# Tensorflow Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Zheqi He and Xinlei Chen
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from __f... | 45.97076 | 120 | 0.547767 |
79477bc2b9069f063dda32227e48a0ec9dedad3b | 473 | py | Python | ai_ml_projects/masters_courses/image_and_vision_processing/intensityscale.py | 5aurabhpathak/src | dda72beba2aaae67542a2f10e89048e86d04cb28 | [
"BSD-3-Clause"
] | 1 | 2021-07-07T06:51:18.000Z | 2021-07-07T06:51:18.000Z | ai_ml_projects/masters_courses/image_and_vision_processing/intensityscale.py | 5aurabhpathak/all-I-ve-done | dda72beba2aaae67542a2f10e89048e86d04cb28 | [
"BSD-3-Clause"
] | null | null | null | ai_ml_projects/masters_courses/image_and_vision_processing/intensityscale.py | 5aurabhpathak/all-I-ve-done | dda72beba2aaae67542a2f10e89048e86d04cb28 | [
"BSD-3-Clause"
] | 1 | 2020-08-11T09:53:22.000Z | 2020-08-11T09:53:22.000Z | #!/bin/env python3.5
from matplotlib import pyplot as pl
from numpy import max, min
def disp(im, n, t):
pl.subplot(120 + n)
pl.title(t)
pl.axis('off')
pl.imshow(im, pl.get_cmap('Greys_r'))
im = pl.imread('data/cameraman.tif').astype('uint16')
print('In=\n',im)
disp(im,1, 'input')
out = (30 + im * 150... | 24.894737 | 83 | 0.638478 |
79479d7c8c056c0421467bc30ff31b0444fcbcaf | 3,565 | py | Python | venv/Lib/site-packages/pyrogram/raw/types/messages/peer_dialogs.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/types/messages/peer_dialogs.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/messages/peer_dialogs.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 34.95098 | 197 | 0.617952 |
7947b3bf08972c42264adde426fb94f43a50092a | 11,245 | py | Python | rf2settings/app_settings.py | tappi287/rf2_video_settings | 6ae73c63f48e6d515a9efb653f236dea0494d9f1 | [
"MIT"
] | 8 | 2020-12-09T17:34:40.000Z | 2022-02-21T10:15:09.000Z | rf2settings/app_settings.py | tappi287/rf2_video_settings | 6ae73c63f48e6d515a9efb653f236dea0494d9f1 | [
"MIT"
] | 11 | 2021-02-27T00:21:47.000Z | 2022-02-25T14:41:56.000Z | rf2settings/app_settings.py | tappi287/rf2_video_settings | 6ae73c63f48e6d515a9efb653f236dea0494d9f1 | [
"MIT"
] | 2 | 2021-06-28T21:11:53.000Z | 2022-02-06T17:20:18.000Z | import json
import logging
from pathlib import Path, WindowsPath
from shutil import copyfile
from typing import Iterator, Union, Dict
from .globals import get_settings_dir, SETTINGS_FILE_NAME, SETTINGS_CONTENT_FILE_NAME, get_default_presets_dir, \
get_present_mon_bin
from .preset.preset_base import PRESET_TYPES
fr... | 35.698413 | 117 | 0.601334 |
7947ea7425f1c0daf4d66cf8aac431401496318e | 3,250 | py | Python | common/database/main.py | dnguyen0304/python-common | 7fdcc584d223c277e3cdb0336cc923a4f9adcece | [
"MIT"
] | null | null | null | common/database/main.py | dnguyen0304/python-common | 7fdcc584d223c277e3cdb0336cc923a4f9adcece | [
"MIT"
] | null | null | null | common/database/main.py | dnguyen0304/python-common | 7fdcc584d223c277e3cdb0336cc923a4f9adcece | [
"MIT"
] | 1 | 2018-09-19T00:40:10.000Z | 2018-09-19T00:40:10.000Z | # -*- coding: utf-8 -*-
import datetime
import sqlalchemy
from sqlalchemy import orm
class DBContext:
def __init__(self, session):
"""
Decorator class that manages persistence operations for
ORM-mapped objects.
Parameters
----------
session : sqlalchemy.orm.ses... | 26.639344 | 72 | 0.585231 |
7947f45ac8bc384fbcbb39197a6a9122e89ec90d | 880 | py | Python | spider/data_collector.py | glstr/python_learning | 243908d6f358764386f2e58dfbfde10a406d803c | [
"Apache-2.0"
] | 2 | 2018-09-20T06:08:00.000Z | 2018-09-26T13:57:20.000Z | spider/data_collector.py | glstr/python_learning | 243908d6f358764386f2e58dfbfde10a406d803c | [
"Apache-2.0"
] | null | null | null | spider/data_collector.py | glstr/python_learning | 243908d6f358764386f2e58dfbfde10a406d803c | [
"Apache-2.0"
] | 1 | 2019-03-25T05:53:32.000Z | 2019-03-25T05:53:32.000Z | #!/usr/bin/python
# coding=utf-8
import json
import requests
class DataCollector(object):
def __init__(self):
self.name = "default data collector"
return
def grab(self, option):
url = option["url"]
r = requests.get(url)
r.json()
return r
def gather(se... | 20.465116 | 44 | 0.542045 |
79482da99e23ce36ad25c3058513f74a4e0a6483 | 11,054 | py | Python | resolwe_bio/kb/tests/test_feature.py | MiaZganjar/resolwe-bio | 1559435796cb40905d81c8fd14872f7ac66e66e8 | [
"Apache-2.0"
] | null | null | null | resolwe_bio/kb/tests/test_feature.py | MiaZganjar/resolwe-bio | 1559435796cb40905d81c8fd14872f7ac66e66e8 | [
"Apache-2.0"
] | null | null | null | resolwe_bio/kb/tests/test_feature.py | MiaZganjar/resolwe-bio | 1559435796cb40905d81c8fd14872f7ac66e66e8 | [
"Apache-2.0"
] | null | null | null | from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from resolwe.test import TestCase
from ..models import Feature
class FeatureTestCase(TestCase, APITestCase):
@staticmethod
def create_feature(index, source, species, feature_type):
return Fe... | 37.09396 | 87 | 0.585308 |
7948331fbb0765637ab6421132612652e4ed63b1 | 20,709 | py | Python | setup.py | sallysyw/vision | bf073e785528970e6a1605e411e4fc382d686dc7 | [
"BSD-3-Clause"
] | null | null | null | setup.py | sallysyw/vision | bf073e785528970e6a1605e411e4fc382d686dc7 | [
"BSD-3-Clause"
] | null | null | null | setup.py | sallysyw/vision | bf073e785528970e6a1605e411e4fc382d686dc7 | [
"BSD-3-Clause"
] | null | null | null | import distutils.command.clean
import distutils.spawn
import glob
import os
import shutil
import subprocess
import sys
import torch
from pkg_resources import parse_version, get_distribution, DistributionNotFound
from setuptools import setup, find_packages
from torch.utils.cpp_extension import BuildExtension, CppExtens... | 38.564246 | 111 | 0.606403 |
794873c8b74607ff71092388f155d5b0e53c1eca | 5,028 | py | Python | src/PlotGrids.py | LukeMcCulloch/PyCFD | 6720e6575e25f8c274ef591d6c215de90a740935 | [
"MIT"
] | 1 | 2020-07-04T15:42:15.000Z | 2020-07-04T15:42:15.000Z | src/PlotGrids.py | LukeMcCulloch/PyCFD | 6720e6575e25f8c274ef591d6c215de90a740935 | [
"MIT"
] | null | null | null | src/PlotGrids.py | LukeMcCulloch/PyCFD | 6720e6575e25f8c274ef591d6c215de90a740935 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 5 16:04:47 2020
@author: lukemcculloch
"""
import numpy as np
# imports for plotting:
import matplotlib.pyplot as plt
class PlotGrid(object):
def __init__(self, grid):
self.grid = grid
def plot_cells(self, canva... | 29.063584 | 73 | 0.380072 |
79487cef795b3b05a7ec6da869b93b6ed4124c30 | 6,430 | py | Python | deprecated_nets/net_focal.py | danielmk/pyDentateeLife2020 | b4a9f2beaa0c74dbc9583e2cf228856612596f8a | [
"MIT"
] | 1 | 2022-02-24T20:39:46.000Z | 2022-02-24T20:39:46.000Z | deprecated_nets/net_focal.py | danielmk/pyDentateeLife2020 | b4a9f2beaa0c74dbc9583e2cf228856612596f8a | [
"MIT"
] | null | null | null | deprecated_nets/net_focal.py | danielmk/pyDentateeLife2020 | b4a9f2beaa0c74dbc9583e2cf228856612596f8a | [
"MIT"
] | 4 | 2020-02-18T09:25:20.000Z | 2021-11-20T23:52:29.000Z | # -*- coding: utf-8 -*-
"""
This module implements the class StandardNetwork.
StandardNetwork creates a ring network as defined in Santhakumar et al. 2005
with some changes as in Yim et al. 2015.
See StandardNetwork docstring for details.
Created on Tue Nov 28 13:01:38 2017
@author: DanielM
"""
from neuron import h, ... | 45.928571 | 98 | 0.494712 |
7948bd7d09cf1dbd26dee5eab201ac3dc58b399f | 5,878 | py | Python | discord/stage_instance.py | CuzImSyntax/dis.py | 2f56d546f2594e1dbb6955c8b13b3a884a04eca6 | [
"MIT"
] | 1 | 2021-09-11T13:39:44.000Z | 2021-09-11T13:39:44.000Z | discord/stage_instance.py | CuzImSyntax/discordIO | 47cd508ed48004aa61a41a5b196d3ff003456219 | [
"MIT"
] | null | null | null | discord/stage_instance.py | CuzImSyntax/discordIO | 47cd508ed48004aa61a41a5b196d3ff003456219 | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015-2021 Rapptz 2021-present CuzImSyntax
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to u... | 33.20904 | 132 | 0.6623 |
7948ee2bfa94828f03e885961494e1c29b05c1d9 | 3,612 | py | Python | orthgan/updater.py | HMJiangGatech/chainer-gan-lib | ee6764b2b2a9d7309267fd1b95835b883464aee1 | [
"MIT"
] | 4 | 2019-07-31T02:20:43.000Z | 2020-02-18T05:33:05.000Z | orthgan/updater.py | HMJiangGatech/chainer-gan-lib | ee6764b2b2a9d7309267fd1b95835b883464aee1 | [
"MIT"
] | null | null | null | orthgan/updater.py | HMJiangGatech/chainer-gan-lib | ee6764b2b2a9d7309267fd1b95835b883464aee1 | [
"MIT"
] | 1 | 2021-11-13T22:53:05.000Z | 2021-11-13T22:53:05.000Z | import numpy as np
import chainer
import chainer.functions as F
from chainer import Variable
class Updater(chainer.training.StandardUpdater):
def __init__(self, *args, **kwargs):
self.gen, self.dis = kwargs.pop('models')
self.n_dis = kwargs.pop('n_dis')
super(Updater, self).__init__(*args... | 34.730769 | 82 | 0.556202 |
7949068b81848b1ec1d756a7b7803534047ab920 | 792 | py | Python | satchless/product/handler.py | cajun-code/satchless | 068b26046c3af63268f8eecd6e33da2bbb78b8d1 | [
"BSD-4-Clause"
] | 1 | 2015-11-05T05:09:27.000Z | 2015-11-05T05:09:27.000Z | satchless/product/handler.py | cajun-code/satchless | 068b26046c3af63268f8eecd6e33da2bbb78b8d1 | [
"BSD-4-Clause"
] | null | null | null | satchless/product/handler.py | cajun-code/satchless | 068b26046c3af63268f8eecd6e33da2bbb78b8d1 | [
"BSD-4-Clause"
] | null | null | null | from django.conf import settings
from django.utils.importlib import import_module
from django.http import HttpResponse
_handlers_queue = None
def product_view(instances, request):
context = {}
for handler in _handlers_queue:
context = handler(instances, request=request, extra_context=context)
... | 30.461538 | 76 | 0.698232 |
79491614dceb323c022da2f467de3caabf704186 | 1,503 | py | Python | tests/unit/flows/test_duckdb_transform.py | angelika233/viadot | 99a4c5b622ad099a44ab014a47ba932a747c0ae6 | [
"MIT"
] | null | null | null | tests/unit/flows/test_duckdb_transform.py | angelika233/viadot | 99a4c5b622ad099a44ab014a47ba932a747c0ae6 | [
"MIT"
] | null | null | null | tests/unit/flows/test_duckdb_transform.py | angelika233/viadot | 99a4c5b622ad099a44ab014a47ba932a747c0ae6 | [
"MIT"
] | null | null | null | import os
import pytest
from viadot.flows import DuckDBTransform
from viadot.sources import DuckDB
BRONZE_SCHEMA = "bronze_schema"
SILVER_SCHEMA = "silver_schema"
TABLE = "test_table"
DATABASE_PATH = "test_db_1234.duckdb"
CREDENTIALS = dict(database=DATABASE_PATH)
@pytest.fixture(scope="session")
def duckdb():
... | 30.673469 | 95 | 0.725882 |
79492c47d79ccc93adb74a66a8ed4b31d0e6dc1b | 2,128 | py | Python | watermarking.py | mlouielu/watermarking | a317d26727b09e0b51018ba8f40c549a56ae181f | [
"MIT"
] | null | null | null | watermarking.py | mlouielu/watermarking | a317d26727b09e0b51018ba8f40c549a56ae181f | [
"MIT"
] | null | null | null | watermarking.py | mlouielu/watermarking | a317d26727b09e0b51018ba8f40c549a56ae181f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import random
from typing import Tuple
import click
from PIL import Image, ImageFont, ImageDraw
def get_text_im(font: ImageFont, text: str, color: Tuple, rotate: int) -> Image:
# Text
text_im = Image.new("RGBA", font.getsize(text), (255, 255, 255, 0))
text_draw = ImageDraw.Draw(te... | 31.294118 | 86 | 0.620301 |
7949625c3dfa46c51b856a51efc1b744225c4c0e | 1,667 | py | Python | bfgame/effects/healing.py | ChrisLR/BasicDungeonRL | b293d40bd9a0d3b7aec41b5e1d58441165997ff1 | [
"MIT"
] | 3 | 2017-10-28T11:28:38.000Z | 2018-09-12T09:47:00.000Z | bfgame/effects/healing.py | ChrisLR/BasicDungeonRL | b293d40bd9a0d3b7aec41b5e1d58441165997ff1 | [
"MIT"
] | null | null | null | bfgame/effects/healing.py | ChrisLR/BasicDungeonRL | b293d40bd9a0d3b7aec41b5e1d58441165997ff1 | [
"MIT"
] | null | null | null | from core.effects.base import Effect
from bflib import effects
from bflib.dice import D6
from core.contexts import Action
from core.messaging import StringBuilder, Actor, Verb
class Healing(Effect):
name = "Healing"
base_effect = effects.Healing
"""
Every round, recover health
"""
def __init_... | 27.783333 | 85 | 0.59928 |
7949765f7f07f52e54996497b9e2297b439e784d | 1,082 | py | Python | body_temp_from_external/conv_core_temp.py | SoftwareDevEngResearch/body_temp_from_external | 2f560ccc51e9f3c5bde25630b811586972fe884c | [
"MIT"
] | 1 | 2020-02-15T05:30:07.000Z | 2020-02-15T05:30:07.000Z | body_temp_from_external/conv_core_temp.py | SoftwareDevEngResearch/body_temp_from_external | 2f560ccc51e9f3c5bde25630b811586972fe884c | [
"MIT"
] | null | null | null | body_temp_from_external/conv_core_temp.py | SoftwareDevEngResearch/body_temp_from_external | 2f560ccc51e9f3c5bde25630b811586972fe884c | [
"MIT"
] | 3 | 2018-04-18T23:39:00.000Z | 2020-03-15T14:46:20.000Z | #!/usr/bin/env python
# Author: Makenzie Brian
# Date: April 23, 2018
# Class: ME 599
# File: conv_core_temp.py
# Description: converts csv to estimated core temperature
def conv_file(file):
"""converts csv to array for use in later functions
args: filename as .csv"""
with open(file, 'r') as f1:
... | 31.823529 | 107 | 0.676525 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.