hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
790d63f065ecd4e3b6431e8fcb5ae11dec6027e2 | 2,530 | py | Python | livelossplot/keras_plot.py | kkanska/livelossplot | 20715b3c16656e22a1371e0b9bb45ae4a7718a71 | [
"MIT"
] | 1 | 2019-03-07T12:49:58.000Z | 2019-03-07T12:49:58.000Z | livelossplot/keras_plot.py | kkanska/livelossplot | 20715b3c16656e22a1371e0b9bb45ae4a7718a71 | [
"MIT"
] | null | null | null | livelossplot/keras_plot.py | kkanska/livelossplot | 20715b3c16656e22a1371e0b9bb45ae4a7718a71 | [
"MIT"
] | null | null | null | from __future__ import division
from keras.callbacks import Callback
from .generic_plot import PlotLosses
metric2printable = {
"acc": "Accuracy",
"mean_squared_error": "Mean squared error",
"mean_absolute_error": "Mean absolute error",
"mean_absolute_percentage_error": "Mean absolute percentage error"... | 36.142857 | 101 | 0.641107 | from __future__ import division
from keras.callbacks import Callback
from .generic_plot import PlotLosses
metric2printable = {
"acc": "Accuracy",
"mean_squared_error": "Mean squared error",
"mean_absolute_error": "Mean absolute error",
"mean_absolute_percentage_error": "Mean absolute percentage error"... | true | true |
790d64784359740d132bbba12433a5a99da3ca03 | 77,727 | py | Python | bert4keras/models.py | CurisZhou/bert4keras | 216f408b0501a1e6e6903c7a6271213d88f7725c | [
"Apache-2.0"
] | null | null | null | bert4keras/models.py | CurisZhou/bert4keras | 216f408b0501a1e6e6903c7a6271213d88f7725c | [
"Apache-2.0"
] | null | null | null | bert4keras/models.py | CurisZhou/bert4keras | 216f408b0501a1e6e6903c7a6271213d88f7725c | [
"Apache-2.0"
] | null | null | null | #! -*- coding: utf-8 -*-
# 主要模型
import numpy as np
from bert4keras.layers import *
from bert4keras.snippets import insert_arguments
from bert4keras.snippets import delete_arguments
from bert4keras.snippets import is_string
from keras.models import Model
import json
class Transformer(object):
"""模型基类
"""
... | 33.316331 | 121 | 0.536853 |
import numpy as np
from bert4keras.layers import *
from bert4keras.snippets import insert_arguments
from bert4keras.snippets import delete_arguments
from bert4keras.snippets import is_string
from keras.models import Model
import json
class Transformer(object):
def __init__(
self,
vocab_size,
... | true | true |
790d665955845251d27d1b13cc3d9cea5240ebcc | 1,065 | py | Python | manage.py | Tianny/incepiton_mysql | 8ef86d19f26e22a39b4fac99ea0b4286c3226b6f | [
"MIT"
] | 74 | 2018-01-04T09:36:32.000Z | 2018-09-06T07:13:57.000Z | manage.py | Tianny/incepiton-mysql | 8ef86d19f26e22a39b4fac99ea0b4286c3226b6f | [
"MIT"
] | 1 | 2018-02-24T09:00:15.000Z | 2018-04-20T02:08:52.000Z | manage.py | Tianny/incepiton_mysql | 8ef86d19f26e22a39b4fac99ea0b4286c3226b6f | [
"MIT"
] | 23 | 2018-01-13T05:26:22.000Z | 2018-07-05T13:34:07.000Z | import os
from werkzeug.security import generate_password_hash
from flask_script import Manager, Shell, Command, Option
from flask_migrate import Migrate, MigrateCommand
from app import db
from app import create_app
from app.models import User
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manage... | 24.767442 | 68 | 0.684507 | import os
from werkzeug.security import generate_password_hash
from flask_script import Manager, Shell, Command, Option
from flask_migrate import Migrate, MigrateCommand
from app import db
from app import create_app
from app.models import User
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manage... | true | true |
790d674cff7ae664cf013b310e5bf3172325ca2f | 562 | py | Python | src/SRM-684/istr.py | mikefeneley/topcoder | 175a7a05367c0458a900a3fea16af68ae5ee53ec | [
"MIT"
] | null | null | null | src/SRM-684/istr.py | mikefeneley/topcoder | 175a7a05367c0458a900a3fea16af68ae5ee53ec | [
"MIT"
] | null | null | null | src/SRM-684/istr.py | mikefeneley/topcoder | 175a7a05367c0458a900a3fea16af68ae5ee53ec | [
"MIT"
] | null | null | null | import operator
class Istr:
def count(self, s, k):
letters = {}
for letter in s:
if letter not in letters:
letters[letter] = 1
else:
letters[letter] += 1
for i in range(0, k):
index = max(lett... | 21.615385 | 77 | 0.455516 | import operator
class Istr:
def count(self, s, k):
letters = {}
for letter in s:
if letter not in letters:
letters[letter] = 1
else:
letters[letter] += 1
for i in range(0, k):
index = max(lett... | true | true |
790d675788b5a41ef28bcd938287045fb6fc3696 | 219 | py | Python | src/day_16/src/models/__init__.py | chenyuanqi/python-training | 3bbc2a45304de57cbc23b46da1ba7d38c8fad6e0 | [
"Apache-2.0"
] | null | null | null | src/day_16/src/models/__init__.py | chenyuanqi/python-training | 3bbc2a45304de57cbc23b46da1ba7d38c8fad6e0 | [
"Apache-2.0"
] | null | null | null | src/day_16/src/models/__init__.py | chenyuanqi/python-training | 3bbc2a45304de57cbc23b46da1ba7d38c8fad6e0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# _*_ coding:utf-8 _*_
# Created by vikey on 2018/2/17
from __future__ import print_function
from __future__ import unicode_literals
def main():
pass
if __name__ == "__main__":
main()
| 14.6 | 39 | 0.707763 |
from __future__ import print_function
from __future__ import unicode_literals
def main():
pass
if __name__ == "__main__":
main()
| true | true |
790d682d59733918b6d1a5934d0417de1016946a | 2,061 | py | Python | simple-telnet-deception.py | raresteak/simple-telnet-deception | f7d1271ccaf01d5d6b206e88a52402f0240323b3 | [
"BSD-2-Clause"
] | null | null | null | simple-telnet-deception.py | raresteak/simple-telnet-deception | f7d1271ccaf01d5d6b206e88a52402f0240323b3 | [
"BSD-2-Clause"
] | 2 | 2021-10-05T15:59:10.000Z | 2021-10-05T16:31:38.000Z | simple-telnet-deception.py | raresteak/simple-telnet-deception | f7d1271ccaf01d5d6b206e88a52402f0240323b3 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
# purpose: Mimics a simple telnet daemon login prompts and records output
# starts a tcp listener on port and address with variables defined below
# author: Raresteak
# date: 6 October 2021
# version: 3
import datetime
import socket
HOST = '127.0.0.1'
PORT = 2323
FILE = "stn-results.json"
fh = o... | 37.472727 | 145 | 0.447841 |
import datetime
import socket
HOST = '127.0.0.1'
PORT = 2323
FILE = "stn-results.json"
fh = open(FILE, "a")
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((HOST, PORT))
s.listen()
while True:
conn, addr = s.acce... | true | true |
790d685e82700fc2d434189758494db076f50329 | 6,133 | py | Python | predict/ensemble.py | DataArk/CHIP2021-Task1-Top1 | e352198d96d31c60541e4a271f20cc23b3ab6b92 | [
"Apache-2.0"
] | 15 | 2021-12-18T06:08:55.000Z | 2022-03-30T00:41:45.000Z | predict/ensemble.py | confstantine/nlp-task | cb152e885bc6f6f1243a12ad90b1c715eb548736 | [
"Apache-2.0"
] | 1 | 2021-12-20T05:57:37.000Z | 2021-12-20T13:43:07.000Z | predict/ensemble.py | DataArk/CHIP2021-Task1-Top1 | e352198d96d31c60541e4a271f20cc23b3ab6b92 | [
"Apache-2.0"
] | 1 | 2021-12-27T04:49:35.000Z | 2021-12-27T04:49:35.000Z | import codecs
import json
from tqdm import tqdm
import copy
submit_result2 = []
with codecs.open('dialog_chinese-macbert.txt', mode='r', encoding='utf8') as f:
reader = f.readlines(f)
data_list = []
for dialogue_idx_, dialogue_ in enumerate(tqdm(reader)):
dialogue_ = json.loads(dialogue_)
submit_re... | 51.537815 | 268 | 0.612098 | import codecs
import json
from tqdm import tqdm
import copy
submit_result2 = []
with codecs.open('dialog_chinese-macbert.txt', mode='r', encoding='utf8') as f:
reader = f.readlines(f)
data_list = []
for dialogue_idx_, dialogue_ in enumerate(tqdm(reader)):
dialogue_ = json.loads(dialogue_)
submit_re... | true | true |
790d687e1a550df847e9c24f9d009229bbdf2d1b | 108 | py | Python | tests/test_apps/helloworld/hello.py | BlueMoon55/flask_test | eb32cf47b336dcf633cf4d85ed03478c003a74d7 | [
"BSD-3-Clause"
] | null | null | null | tests/test_apps/helloworld/hello.py | BlueMoon55/flask_test | eb32cf47b336dcf633cf4d85ed03478c003a74d7 | [
"BSD-3-Clause"
] | null | null | null | tests/test_apps/helloworld/hello.py | BlueMoon55/flask_test | eb32cf47b336dcf633cf4d85ed03478c003a74d7 | [
"BSD-3-Clause"
] | null | null | null | from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
| 15.428571 | 26 | 0.62963 | from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
| true | true |
790d6881b84d575211ea1bf0221cc97754b74dc7 | 2,532 | py | Python | examples/pybullet/examples/vrEvent.py | frk2/bullet3 | 225d823e4dc3f952c6c39920c3f87390383e0602 | [
"Zlib"
] | 27 | 2018-05-21T14:28:10.000Z | 2021-12-31T03:12:35.000Z | examples/pybullet/examples/vrEvent.py | frk2/bullet3 | 225d823e4dc3f952c6c39920c3f87390383e0602 | [
"Zlib"
] | 2 | 2018-02-02T21:26:09.000Z | 2018-02-06T19:05:24.000Z | examples/pybullet/examples/vrEvent.py | frk2/bullet3 | 225d823e4dc3f952c6c39920c3f87390383e0602 | [
"Zlib"
] | 13 | 2019-11-08T12:48:44.000Z | 2022-01-04T04:13:33.000Z | # See pybullet quickstart guide here:
# https://docs.google.com/document/d/10sXEhzFRSnvFcl3XxNGhnD4N2SedqwdAvK3dsihxVUA/edit#
# Create a Tiltbrush-like app, drawing lines using any controller
# Line width can be changed
import pybullet as p
CONTROLLER_ID = 0
POSITION=1
ORIENTATION=2
NUM_MOVE_EVENTS=5
BUTTONS=6
ANALOG... | 30.142857 | 122 | 0.699052 |
import pybullet as p
CONTROLLER_ID = 0
POSITION=1
ORIENTATION=2
NUM_MOVE_EVENTS=5
BUTTONS=6
ANALOG_AXIS=8
c = p.connect(p.SHARED_MEMORY)
print(c)
if (c<0):
p.connect(p.GUI)
p.setInternalSimFlags(0)
p.resetSimulation()
p.loadURDF("plane.urdf")
prevPosition=[[0,0,0]]*p.VR_MAX_CONTROLLERS
colors=[0.,0.5,0.5]*p.... | true | true |
790d6934b720f8d7e4a229513ef60df1a9ed7fd8 | 6,669 | py | Python | dino/main.py | bartlomiej-kedziora/games | 00ff00566bd7c0cd444161f3edf6cd7e1f4abb62 | [
"MIT"
] | null | null | null | dino/main.py | bartlomiej-kedziora/games | 00ff00566bd7c0cd444161f3edf6cd7e1f4abb62 | [
"MIT"
] | null | null | null | dino/main.py | bartlomiej-kedziora/games | 00ff00566bd7c0cd444161f3edf6cd7e1f4abb62 | [
"MIT"
] | null | null | null | import pgzero
import pgzrun
import random
from pgzero.actor import Actor
__all__ = ["pgzrun", "pgzero"]
from pgzero.clock import clock
from pgzero.keyboard import keyboard
from pgzero.loaders import sounds
clouds = [Actor('cloud1', (200, 200)),
Actor('cloud2', (400, 300)),
Actor('cloud3', (600, ... | 24.791822 | 97 | 0.562453 | import pgzero
import pgzrun
import random
from pgzero.actor import Actor
__all__ = ["pgzrun", "pgzero"]
from pgzero.clock import clock
from pgzero.keyboard import keyboard
from pgzero.loaders import sounds
clouds = [Actor('cloud1', (200, 200)),
Actor('cloud2', (400, 300)),
Actor('cloud3', (600, ... | true | true |
790d69a0863f817c9600d9648b29c56aefa86acd | 2,180 | py | Python | venv/lib/python3.8/site-packages/vsts/release/v4_1/models/release_task_attachment.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/vsts/release/v4_1/models/release_task_attachment.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/vsts/release/v4_1/models/release_task_attachment.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------------------... | 40.37037 | 146 | 0.544495 |
from msrest.serialization import Model
class ReleaseTaskAttachment(Model):
_attribute_map = {
'_links': {'key': '_links', 'type': 'ReferenceLinks'},
'created_on': {'key': 'createdOn', 'type': 'iso-8601'},
'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'},
... | true | true |
790d69c2fe14e452fd81adf6722dffb4d6179f1f | 41 | py | Python | recover_unseeded.py | maziara/deluge-feed-innoreader | 874ae84d5f75569a6749e44f8c525e484aa801b7 | [
"MIT"
] | 8 | 2016-07-31T01:58:00.000Z | 2020-09-30T01:18:34.000Z | recover_unseeded.py | maziara/deluge-feed-innoreader | 874ae84d5f75569a6749e44f8c525e484aa801b7 | [
"MIT"
] | null | null | null | recover_unseeded.py | maziara/deluge-feed-innoreader | 874ae84d5f75569a6749e44f8c525e484aa801b7 | [
"MIT"
] | null | null | null | import main
main.recover_unseeded_items() | 20.5 | 29 | 0.878049 | import main
main.recover_unseeded_items() | true | true |
790d6a1d89941bbe74cb2ee771b7995accfaed15 | 6,752 | py | Python | src/ggrc_workflows/migrations/versions/20150707143127_44047daa31a9_add_non_adjusted_next_cycle_start_date.py | zidarsk8/ggrc-core | 2509c989eddf434249d3bef50c21e08dbf56c1a4 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2018-01-03T02:49:23.000Z | 2018-01-03T02:49:23.000Z | src/ggrc_workflows/migrations/versions/20150707143127_44047daa31a9_add_non_adjusted_next_cycle_start_date.py | zidarsk8/ggrc-core | 2509c989eddf434249d3bef50c21e08dbf56c1a4 | [
"ECL-2.0",
"Apache-2.0"
] | 6 | 2015-04-25T13:15:15.000Z | 2019-03-21T22:38:01.000Z | src/ggrc_workflows/migrations/versions/20150707143127_44047daa31a9_add_non_adjusted_next_cycle_start_date.py | zidarsk8/ggrc-core | 2509c989eddf434249d3bef50c21e08dbf56c1a4 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Add non-adjusted next cycle start date
Revision ID: 44047daa31a9
Revises: 1431e7094e26
Create Date: 2015-07-07 14:31:27.780564
"""
# revision identifiers, used by Alembic.
revision = '44047daa31a9'
dow... | 38.146893 | 80 | 0.598045 |
revision = '44047daa31a9'
down_revision = '4840f4760f4b'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
from datetime import date
from ggrc.app import app
from ggrc import settings, db
import ggrc_workflows.models as models
from ggrc_workflows import adjust_next_cycle_start_... | true | true |
790d6a227b95a008a2221d0e4dbd56cad8afaad3 | 152,075 | py | Python | kapua-client/python-client/swagger_client/api/devices_api.py | liang-faan/SmartIOT-Diec | 8336a4b558295295f10a82cf350d8b7ff3fb9f5c | [
"MIT"
] | null | null | null | kapua-client/python-client/swagger_client/api/devices_api.py | liang-faan/SmartIOT-Diec | 8336a4b558295295f10a82cf350d8b7ff3fb9f5c | [
"MIT"
] | null | null | null | kapua-client/python-client/swagger_client/api/devices_api.py | liang-faan/SmartIOT-Diec | 8336a4b558295295f10a82cf350d8b7ff3fb9f5c | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Eclipse Kapua REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
... | 44.859882 | 426 | 0.624324 |
from __future__ import absolute_import
import re
import six
from swagger_client.api_client import ApiClient
class DevicesApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def device_asset_filte... | true | true |
790d6a3efac390378876a5be53e7f10b1530fb5c | 28,191 | py | Python | tests/migrations/test_writer.py | robgolding/django | 1d0bab0bfd77edcf1228d45bf654457a8ff1890d | [
"PSF-2.0",
"BSD-3-Clause"
] | 5 | 2019-10-17T21:29:53.000Z | 2021-06-23T16:27:02.000Z | tests/migrations/test_writer.py | robgolding/django | 1d0bab0bfd77edcf1228d45bf654457a8ff1890d | [
"PSF-2.0",
"BSD-3-Clause"
] | 10 | 2016-05-19T21:54:42.000Z | 2019-08-09T15:59:50.000Z | tests/migrations/test_writer.py | robgolding/django | 1d0bab0bfd77edcf1228d45bf654457a8ff1890d | [
"PSF-2.0",
"BSD-3-Clause"
] | 11 | 2019-09-14T20:57:30.000Z | 2022-01-19T17:59:26.000Z | import datetime
import decimal
import enum
import functools
import math
import os
import re
import uuid
from unittest import mock
import custom_migration_operations.more_operations
import custom_migration_operations.operations
from django import get_version
from django.conf import SettingsReference, settings
from dja... | 41.888559 | 118 | 0.631975 | import datetime
import decimal
import enum
import functools
import math
import os
import re
import uuid
from unittest import mock
import custom_migration_operations.more_operations
import custom_migration_operations.operations
from django import get_version
from django.conf import SettingsReference, settings
from dja... | true | true |
790d6b4ad1b4eae37dac46c169794c84eb65e406 | 6,486 | py | Python | tests/openapi/test_validation.py | dreuse/kinto | 533037ad421b63419f9883653a428683c67d43b8 | [
"Apache-2.0"
] | null | null | null | tests/openapi/test_validation.py | dreuse/kinto | 533037ad421b63419f9883653a428683c67d43b8 | [
"Apache-2.0"
] | null | null | null | tests/openapi/test_validation.py | dreuse/kinto | 533037ad421b63419f9883653a428683c67d43b8 | [
"Apache-2.0"
] | null | null | null | from bravado_core.request import IncomingRequest, unmarshal_request
from bravado_core.swagger20_validator import ValidationError
from .support import OpenAPITest
class OpenAPIRequestsValidationTest(OpenAPITest):
def setUp(self):
super().setUp()
self.request = IncomingRequest()
self.reque... | 34.870968 | 99 | 0.557046 | from bravado_core.request import IncomingRequest, unmarshal_request
from bravado_core.swagger20_validator import ValidationError
from .support import OpenAPITest
class OpenAPIRequestsValidationTest(OpenAPITest):
def setUp(self):
super().setUp()
self.request = IncomingRequest()
self.reque... | true | true |
790d6bc82351cc457b84198eafb931c2ef75e9b8 | 17,632 | py | Python | tests/bugs/core_5275_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_5275_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_5275_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | #coding:utf-8
#
# id: bugs.core_5275
# title: CORE-5275: Expression index may become inconsistent if CREATE INDEX was interrupted after b-tree creation but before commiting
# decription:
# This test (and CORE- ticket) has been created after wrong initial implementation of test for ... | 39.711712 | 452 | 0.556148 |
import pytest
from firebird.qa import db_factory, isql_act, Action
substitutions_1 = [('0: CREATE INDEX LOG: RDB_EXPR_BLOB.*', '0: CREATE INDEX LOG: RDB_EXPR_BLOB'), ('BULK_INSERT_START.*', 'BULK_INSERT_START'), ('.*KILLED BY DATABASE ADMINISTRATOR.*', ''), ('BULK_INSERT... | true | true |
790d6c64277cf767cc545c71a99683f5f5160fa9 | 962 | py | Python | saas/backend/debug/urls.py | nannan00/bk-iam-saas | 217600fa6e5fd466fff9c33c20c4dbd7c69f77d9 | [
"MIT"
] | 7 | 2021-08-13T03:48:16.000Z | 2021-12-20T15:31:38.000Z | saas/backend/debug/urls.py | nannan00/bk-iam-saas | 217600fa6e5fd466fff9c33c20c4dbd7c69f77d9 | [
"MIT"
] | 456 | 2021-08-16T02:13:57.000Z | 2022-03-30T10:02:49.000Z | saas/backend/debug/urls.py | nannan00/bk-iam-saas | 217600fa6e5fd466fff9c33c20c4dbd7c69f77d9 | [
"MIT"
] | 17 | 2021-08-10T04:08:46.000Z | 2022-03-14T14:24:36.000Z | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-权限中心(BlueKing-IAM) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with th... | 50.631579 | 115 | 0.754678 |
from django.urls import path
from . import views
urlpatterns = [
path("", views.DebugViewSet.as_view({"get": "list"}), name="debug.list_debug"),
path("<str:id>/", views.DebugViewSet.as_view({"get": "retrieve"}), name="debug.detail"),
]
| true | true |
790d6cb3a155ec439cad0318ff3fa9dce5e228ef | 267 | py | Python | pylint_django_translations/plugin.py | troyjfarrell/pylint_django_translations | b6c5349379024cdc5445499229bc31330591049a | [
"BSD-3-Clause"
] | null | null | null | pylint_django_translations/plugin.py | troyjfarrell/pylint_django_translations | b6c5349379024cdc5445499229bc31330591049a | [
"BSD-3-Clause"
] | null | null | null | pylint_django_translations/plugin.py | troyjfarrell/pylint_django_translations | b6c5349379024cdc5445499229bc31330591049a | [
"BSD-3-Clause"
] | null | null | null | "Plugin registration"
from pylint.lint import PyLinter
from .checkers import register_checkers
from .suppression import suppress_warnings
def register(linter: PyLinter) -> None:
"Register the plugin"
register_checkers(linter)
suppress_warnings(linter)
| 22.25 | 42 | 0.790262 | from pylint.lint import PyLinter
from .checkers import register_checkers
from .suppression import suppress_warnings
def register(linter: PyLinter) -> None:
register_checkers(linter)
suppress_warnings(linter)
| true | true |
790d6e47e1a19163d57d299b3382141bc440e8c5 | 11,598 | py | Python | Cinder/Ocata/extend/fc_zone_helper.py | doubletao318/New | 1be04d22592af4150a58129e4169d2ea1df25379 | [
"Apache-2.0"
] | 14 | 2019-05-25T01:55:50.000Z | 2021-02-23T06:54:06.000Z | Cinder/Ocata/extend/fc_zone_helper.py | doubletao318/New | 1be04d22592af4150a58129e4169d2ea1df25379 | [
"Apache-2.0"
] | 4 | 2019-12-31T08:46:30.000Z | 2021-10-30T09:27:58.000Z | Cinder/Ocata/extend/fc_zone_helper.py | doubletao318/New | 1be04d22592af4150a58129e4169d2ea1df25379 | [
"Apache-2.0"
] | 17 | 2019-07-31T03:13:07.000Z | 2022-02-21T08:09:15.000Z | # Copyright (c) 2015 Huawei Technologies Co., Ltd.
# 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/licenses/LICENSE-2.0
#
# ... | 41.274021 | 79 | 0.604846 |
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
from oslo_utils import importutils
from cinder import exception
from cinder.i18n import _
from cinder.i18n import _LE
from cinder.i18n import _LI
from cinder.volume import configuration as config
from cinder.... | true | true |
790d6e48c3ce711d691ffe339851840bd6867634 | 5,282 | py | Python | modules/transformer.py | riokt/video-paragraph | 2da3298819e73809af495457db2cf1dfffad712f | [
"MIT"
] | null | null | null | modules/transformer.py | riokt/video-paragraph | 2da3298819e73809af495457db2cf1dfffad712f | [
"MIT"
] | null | null | null | modules/transformer.py | riokt/video-paragraph | 2da3298819e73809af495457db2cf1dfffad712f | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import framework.configbase
import math
import time
import numpy as np
from modules.transformer_encoder import Encoder
from modules.transformer_decoder import Decoder
decay1 = [(i+1)*20**(-1) for i in range(20)]
deca... | 44.762712 | 166 | 0.683453 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import framework.configbase
import math
import time
import numpy as np
from modules.transformer_encoder import Encoder
from modules.transformer_decoder import Decoder
decay1 = [(i+1)*20**(-1) for i in range(20)]
deca... | true | true |
790d6ea3e263f841adc2a3adb570394e159cd2d3 | 157 | py | Python | alarmexception.py | Megha-Bose/Brick-Breaker-Game | b543ec8277193dcca0ec15afab4a4775744b9587 | [
"MIT"
] | 1 | 2021-04-08T04:15:36.000Z | 2021-04-08T04:15:36.000Z | alarmexception.py | Megha-Bose/Brick-Breaker-Game | b543ec8277193dcca0ec15afab4a4775744b9587 | [
"MIT"
] | null | null | null | alarmexception.py | Megha-Bose/Brick-Breaker-Game | b543ec8277193dcca0ec15afab4a4775744b9587 | [
"MIT"
] | null | null | null | ''' Taking characters from terminal without pressing enter for movements '''
from __future__ import print_function
class AlarmException(Exception):
pass | 31.4 | 76 | 0.802548 | from __future__ import print_function
class AlarmException(Exception):
pass | true | true |
790d6edd3e6ec87c0fb40dea98f50155369e3bae | 56,304 | py | Python | datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py | vbarbaresi/integrations-core | ab26ab1cd6c28a97c1ad1177093a93659658c7aa | [
"BSD-3-Clause"
] | null | null | null | datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py | vbarbaresi/integrations-core | ab26ab1cd6c28a97c1ad1177093a93659658c7aa | [
"BSD-3-Clause"
] | 2 | 2021-04-26T13:37:48.000Z | 2021-04-26T13:37:49.000Z | datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py | vbarbaresi/integrations-core | ab26ab1cd6c28a97c1ad1177093a93659658c7aa | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from __future__ import division
import copy
from fnmatch import translate
from math import isinf, isnan
from os.path import isfile
from re import compile
import requests
from prometheus_client.samples im... | 47.554054 | 120 | 0.627327 |
from __future__ import division
import copy
from fnmatch import translate
from math import isinf, isnan
from os.path import isfile
from re import compile
import requests
from prometheus_client.samples import Sample
from six import PY3, iteritems, string_types
from ...config import is_affirmative
from ...errors im... | true | true |
790d6ee6eaa7f2a7b19763772641feb2cf553339 | 10,276 | py | Python | test/units/formats/office/test_xlxtr.py | bronxc/refinery | 9448facf48a0008f27861dd1a5ee8f5218e6bb86 | [
"BSD-3-Clause"
] | 1 | 2022-02-13T20:57:15.000Z | 2022-02-13T20:57:15.000Z | test/units/formats/office/test_xlxtr.py | bronxc/refinery | 9448facf48a0008f27861dd1a5ee8f5218e6bb86 | [
"BSD-3-Clause"
] | null | null | null | test/units/formats/office/test_xlxtr.py | bronxc/refinery | 9448facf48a0008f27861dd1a5ee8f5218e6bb86 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import base64
import lzma
from ... import TestUnitBase
from refinery.units.formats.office.xlxtr import _ref2rc, _rc2ref
class TestCellIndexConverter(TestUnitBase):
def test_concistency(self):
for row in range(1, 12):
for col in range(1, 12):
... | 96.943396 | 130 | 0.672635 |
import base64
import lzma
from ... import TestUnitBase
from refinery.units.formats.office.xlxtr import _ref2rc, _rc2ref
class TestCellIndexConverter(TestUnitBase):
def test_concistency(self):
for row in range(1, 12):
for col in range(1, 12):
ref = _rc2ref(row, col)
... | true | true |
790d70b112d173624d86dc5ffce0b1d185b8a479 | 14,962 | py | Python | examples/eg1/eg1.py | SagarRoy1996/TabularDataExtraction | 59b05dde00272e7f04f56b89bd2139e3a4e252e5 | [
"Apache-2.0"
] | null | null | null | examples/eg1/eg1.py | SagarRoy1996/TabularDataExtraction | 59b05dde00272e7f04f56b89bd2139e3a4e252e5 | [
"Apache-2.0"
] | null | null | null | examples/eg1/eg1.py | SagarRoy1996/TabularDataExtraction | 59b05dde00272e7f04f56b89bd2139e3a4e252e5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import re
from math import radians, degrees
import numpy as np
import pandas as pd
import cv2
from pdftabextract import imgproc
from pdftabextract.geom import pt
from pdftabextract.common import read_xml, parse_pages, save_page_grids
from pdftabextract.textboxes import rotate_textbo... | 46.610592 | 180 | 0.679054 |
import os
import re
from math import radians, degrees
import numpy as np
import pandas as pd
import cv2
from pdftabextract import imgproc
from pdftabextract.geom import pt
from pdftabextract.common import read_xml, parse_pages, save_page_grids
from pdftabextract.textboxes import rotate_textboxes, sorted_by_attr
fro... | true | true |
790d70c7303ba08660f1fc2fc19df3a6b93b2447 | 4,492 | py | Python | manga_py/base_classes/base.py | theincognito-inc/manga-dl | 899905bafb6c6891815b58cce41eaff32a682570 | [
"MIT"
] | 1 | 2020-11-19T00:40:49.000Z | 2020-11-19T00:40:49.000Z | manga_py/base_classes/base.py | eduhoribe/manga-py | fe7eb2e08532b3c75b4f7ac8cc4132f0e7a65eb4 | [
"MIT"
] | null | null | null | manga_py/base_classes/base.py | eduhoribe/manga-py | fe7eb2e08532b3c75b4f7ac8cc4132f0e7a65eb4 | [
"MIT"
] | null | null | null | from logging import warning
from os import path
from typing import Optional, List
from lxml.html import HtmlElement
from manga_py.http import Http
from .params import ProviderParams
class Base(ProviderParams):
_storage = None
_params = None
_image_params = None
_http_kwargs = None
__http = None
... | 29.748344 | 87 | 0.573241 | from logging import warning
from os import path
from typing import Optional, List
from lxml.html import HtmlElement
from manga_py.http import Http
from .params import ProviderParams
class Base(ProviderParams):
_storage = None
_params = None
_image_params = None
_http_kwargs = None
__http = None
... | true | true |
790d70e3cbbdaaa46d1decb3dcc65fb133d8e02c | 18,752 | py | Python | cmdb/views_ajax.py | bopopescu/dbsupport | 9b0f767cebc338fe22f5f3435a8d261101ea35dd | [
"Apache-2.0"
] | 2 | 2019-04-20T06:10:49.000Z | 2020-06-11T08:11:46.000Z | cmdb/views_ajax.py | bopopescu/dbsupport | 9b0f767cebc338fe22f5f3435a8d261101ea35dd | [
"Apache-2.0"
] | null | null | null | cmdb/views_ajax.py | bopopescu/dbsupport | 9b0f767cebc338fe22f5f3435a8d261101ea35dd | [
"Apache-2.0"
] | 1 | 2020-07-22T02:57:46.000Z | 2020-07-22T02:57:46.000Z | # -*- coding: UTF-8 -*-
import datetime
import json
from django.contrib.auth.hashers import check_password, make_password
from django.core import serializers
from django.db import connection
from django.http import HttpResponse
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
... | 44.330969 | 245 | 0.624307 |
import datetime
import json
from django.contrib.auth.hashers import check_password, make_password
from django.core import serializers
from django.db import connection
from django.http import HttpResponse
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from cmdb.models import... | true | true |
790d7258611c71f85ea414a0d78f516bb3b1cbb3 | 219 | py | Python | blink_001.py | luisC62/RPi_Pico_Examples | d2fb34e6ec0835d9265b3bd750add9e2da3eabf7 | [
"MIT"
] | null | null | null | blink_001.py | luisC62/RPi_Pico_Examples | d2fb34e6ec0835d9265b3bd750add9e2da3eabf7 | [
"MIT"
] | null | null | null | blink_001.py | luisC62/RPi_Pico_Examples | d2fb34e6ec0835d9265b3bd750add9e2da3eabf7 | [
"MIT"
] | null | null | null | from machine import Pin
import utime
led = Pin(28, Pin.OUT)
onboard_led = Pin(25, Pin.OUT)
led.low()
onboard_led.high()
while True:
led.toggle()
onboard_led.toggle()
print("Toggle")
utime.sleep(0.5)
| 18.25 | 30 | 0.666667 | from machine import Pin
import utime
led = Pin(28, Pin.OUT)
onboard_led = Pin(25, Pin.OUT)
led.low()
onboard_led.high()
while True:
led.toggle()
onboard_led.toggle()
print("Toggle")
utime.sleep(0.5)
| true | true |
790d728eeac14afc437d0301467e95f1c6a85fee | 978 | py | Python | SRC/December-Batch/02_class/01_list.py | archeranimesh/fantastic-waffle | 74274be44a469dac765379624c489cd5952e9b7c | [
"MIT"
] | null | null | null | SRC/December-Batch/02_class/01_list.py | archeranimesh/fantastic-waffle | 74274be44a469dac765379624c489cd5952e9b7c | [
"MIT"
] | null | null | null | SRC/December-Batch/02_class/01_list.py | archeranimesh/fantastic-waffle | 74274be44a469dac765379624c489cd5952e9b7c | [
"MIT"
] | null | null | null | a = []
# append element at the end.
a.append(2)
a.append(3)
print(a)
# insert at a specific location.
a.insert(0, 5)
a.insert(10, 5)
print(a)
# when specified a position not in list, it inserts at the end.
a.insert(100, 6)
print(a)
# Deleting elements from a list.
a.remove(5) # removes the first occurence of value pa... | 22.227273 | 66 | 0.604294 | a = []
a.append(2)
a.append(3)
print(a)
a.insert(0, 5)
a.insert(10, 5)
print(a)
a.insert(100, 6)
print(a)
a.remove(5)
print(a, len(a))
del a[0]
print(a, len(a))
print(a[-1])
print(len(a))
for item in range(len(a)):
print("(", item, ", ", a[item], ")")
print("-" * 30)
for item in range(0, len(a), 1): ... | true | true |
790d742ca9e0602fc2e720daaa6e3b8267c06812 | 2,395 | py | Python | data/p4VQE/R1/benchmark/startQiskit_Class82.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R1/benchmark/startQiskit_Class82.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R1/benchmark/startQiskit_Class82.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=9
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collection... | 27.215909 | 118 | 0.634238 |
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from qiskit.tes... | true | true |
790d74b84c68d02413bfbc62e01e8661e782f03d | 3,650 | py | Python | support_files/scraping/entries/proj_2062/proj_2062/middlewares.py | miccaldas/new_rss | 9580887ac44b5c3e4c4ed5045478f2c7fef36afe | [
"MIT"
] | null | null | null | support_files/scraping/entries/proj_2062/proj_2062/middlewares.py | miccaldas/new_rss | 9580887ac44b5c3e4c4ed5045478f2c7fef36afe | [
"MIT"
] | null | null | null | support_files/scraping/entries/proj_2062/proj_2062/middlewares.py | miccaldas/new_rss | 9580887ac44b5c3e4c4ed5045478f2c7fef36afe | [
"MIT"
] | null | null | null | # Define here the models for your spider middleware
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
# useful for handling different item types with a single interface
from itemadapter import is_item, ItemAdapter
class Proj2062SpiderMiddleware:
... | 35.096154 | 78 | 0.674521 |
from scrapy import signals
from itemadapter import is_item, ItemAdapter
class Proj2062SpiderMiddleware:
@classmethod
def from_crawler(cls, crawler):
s = cls()
crawler.signals.connect(s.spider_opened, signal=signals.spider_opened)
return s
def proces... | true | true |
790d750c0073c6e8d5d7bf30cbf1030e3f3b4896 | 132 | py | Python | Beginner/1173.py | pedrodanieljardim/DesafiosURI-feitos-em-JAVA | 4e727e1b08e01f527d0b7b884c268643f1472ded | [
"MIT"
] | 1 | 2022-03-19T18:06:25.000Z | 2022-03-19T18:06:25.000Z | Beginner/1173.py | pedrodanieljardim/beecrowd | 4e727e1b08e01f527d0b7b884c268643f1472ded | [
"MIT"
] | null | null | null | Beginner/1173.py | pedrodanieljardim/beecrowd | 4e727e1b08e01f527d0b7b884c268643f1472ded | [
"MIT"
] | null | null | null | n = []
v = int(input())
n.append([v*x*2 for x in range(1,11)])
print(n)
for i in range(len(n)):
print('N[%d] = %d' % (i, n[i]))
| 18.857143 | 38 | 0.5 | n = []
v = int(input())
n.append([v*x*2 for x in range(1,11)])
print(n)
for i in range(len(n)):
print('N[%d] = %d' % (i, n[i]))
| true | true |
790d781330116ec3665c91ad77ec24b53c2d4fc6 | 1,572 | py | Python | problem_6.py | johangenis/problems_vs_algorithms | 9925d7319de849fd7814cf87050232c22d8c2a96 | [
"MIT"
] | null | null | null | problem_6.py | johangenis/problems_vs_algorithms | 9925d7319de849fd7814cf87050232c22d8c2a96 | [
"MIT"
] | null | null | null | problem_6.py | johangenis/problems_vs_algorithms | 9925d7319de849fd7814cf87050232c22d8c2a96 | [
"MIT"
] | null | null | null | def get_min_max(ints):
"""
Return a tuple(min, max) out of list of unsorted integers.
Args:
ints(list): list of integers containing one or more integers
"""
# Handle non-list input
if not isinstance(ints, list):
return None, None
# Define variables for min and max value and... | 26.644068 | 67 | 0.636768 | def get_min_max(ints):
if not isinstance(ints, list):
return None, None
min_value = None
max_value = None
for index, value in enumerate(ints):
if index == 0:
min_value = value
max_value = value
if value < min_value:
min_value = v... | true | true |
790d782a620aacd6fa936c2d559a372314eb37d6 | 2,806 | py | Python | clients/kratos/python/test/test_request_method_config.py | UkonnRa/sdk | 23ab5408a89cdf6ba7a6d8944f8d1b1cdc68aa4c | [
"Apache-2.0"
] | null | null | null | clients/kratos/python/test/test_request_method_config.py | UkonnRa/sdk | 23ab5408a89cdf6ba7a6d8944f8d1b1cdc68aa4c | [
"Apache-2.0"
] | null | null | null | clients/kratos/python/test/test_request_method_config.py | UkonnRa/sdk | 23ab5408a89cdf6ba7a6d8944f8d1b1cdc68aa4c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Ory Kratos
Welcome to the ORY Kratos HTTP API documentation! # noqa: E501
The version of the OpenAPI document: latest
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import datetime
import ory_kratos_client
from ory_krat... | 32.627907 | 100 | 0.497149 |
from __future__ import absolute_import
import unittest
import datetime
import ory_kratos_client
from ory_kratos_client.models.request_method_config import RequestMethodConfig
from ory_kratos_client.rest import ApiException
class TestRequestMethodConfig(unittest.TestCase):
def setUp(self):
pass
... | true | true |
790d78f20215b94be671773f0601de32147c393d | 2,646 | py | Python | detr_tensorflow/models/custom_layers.py | Leonardo-Blanger/detr_tensorflow | 38fc3c586b6767deed09bd7ec6c2a2fd7002346e | [
"MIT"
] | 59 | 2020-07-04T19:14:31.000Z | 2022-03-08T14:30:27.000Z | detr_tensorflow/models/custom_layers.py | Leonardo-Blanger/detr_tensorflow | 38fc3c586b6767deed09bd7ec6c2a2fd7002346e | [
"MIT"
] | 7 | 2020-08-17T23:57:43.000Z | 2022-03-22T02:52:20.000Z | detr_tensorflow/models/custom_layers.py | Leonardo-Blanger/detr_tensorflow | 38fc3c586b6767deed09bd7ec6c2a2fd7002346e | [
"MIT"
] | 14 | 2020-08-17T04:10:16.000Z | 2022-02-06T05:48:33.000Z | import tensorflow as tf
class FrozenBatchNorm2D(tf.keras.layers.Layer):
def __init__(self, eps=1e-5, **kwargs):
super().__init__(**kwargs)
self.eps = eps
def build(self, input_shape):
self.weight = self.add_weight(name='weight', shape=[input_shape[-1]],
... | 38.911765 | 79 | 0.544974 | import tensorflow as tf
class FrozenBatchNorm2D(tf.keras.layers.Layer):
def __init__(self, eps=1e-5, **kwargs):
super().__init__(**kwargs)
self.eps = eps
def build(self, input_shape):
self.weight = self.add_weight(name='weight', shape=[input_shape[-1]],
... | true | true |
790d794890d607e5896329ec11df3c8e12aae1c0 | 18,344 | py | Python | lldb/test/API/python_api/process/TestProcessAPI.py | acidburn0zzz/llvm-project | 7ca7a2547f00e34f5ec91be776a1d0bbca74b7a9 | [
"Apache-2.0"
] | 61 | 2019-04-12T18:49:57.000Z | 2022-03-19T22:23:16.000Z | lldb/test/API/python_api/process/TestProcessAPI.py | acidburn0zzz/llvm-project | 7ca7a2547f00e34f5ec91be776a1d0bbca74b7a9 | [
"Apache-2.0"
] | 127 | 2019-04-09T00:55:50.000Z | 2022-03-21T15:35:41.000Z | lldb/test/API/python_api/process/TestProcessAPI.py | acidburn0zzz/llvm-project | 7ca7a2547f00e34f5ec91be776a1d0bbca74b7a9 | [
"Apache-2.0"
] | 10 | 2019-04-02T18:25:40.000Z | 2022-02-15T07:11:37.000Z | """
Test SBProcess APIs, including ReadMemory(), WriteMemory(), and others.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test.lldbutil import get_stopped_thread, state_type_to_str
class ProcessAPITestCase(TestBase... | 40.22807 | 106 | 0.629089 |
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test.lldbutil import get_stopped_thread, state_type_to_str
class ProcessAPITestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
... | true | true |
790d79ee904552647ec607d5d99d7c416fe813e2 | 2,996 | py | Python | src/avm2/generated/generate.py | paolodm/shumway | 75c8d387b48a2f2e561eb4bc3458162b7cc71b16 | [
"Apache-2.0"
] | 1 | 2015-01-17T05:42:59.000Z | 2015-01-17T05:42:59.000Z | src/avm2/generated/generate.py | Acidburn0zzz/shumway | ef61c3211b91cb62f22441a29b59a0bdbcc2bf93 | [
"Apache-2.0"
] | null | null | null | src/avm2/generated/generate.py | Acidburn0zzz/shumway | ef61c3211b91cb62f22441a29b59a0bdbcc2bf93 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- Mode: Python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4 -*-
# vi: set ts=4 sw=4 expandtab:
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not us... | 42.8 | 239 | 0.697263 |
import os
import subprocess
import sys
def compile_abc(target, files, deps=None, configs=None):
asc_jar = os.environ.get('ASC', os.path.realpath('../../../utils/asc.jar'))
javacmd = ['java', '-ea', '-DAS3', '-DAVMPLUS', '-classpath', asc_jar, 'macromedia.asc.embedding.S... | true | true |
790d7b3bbafa0650cab614e8411daae9b0927426 | 29,770 | py | Python | include/users_pb2.py | toyan/TinkoffNewAPI_Python_use_example | 983c2743b472b3444f77fd06279e2a8f715fb951 | [
"MIT"
] | 1 | 2022-01-20T21:43:31.000Z | 2022-01-20T21:43:31.000Z | include/users_pb2.py | toyan/TinkoffNewAPI_Python_use_example | 983c2743b472b3444f77fd06279e2a8f715fb951 | [
"MIT"
] | null | null | null | include/users_pb2.py | toyan/TinkoffNewAPI_Python_use_example | 983c2743b472b3444f77fd06279e2a8f715fb951 | [
"MIT"
] | 1 | 2022-01-13T03:38:45.000Z | 2022-01-13T03:38:45.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: users.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf... | 42.347084 | 3,323 | 0.777158 |
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
f... | true | true |
790d7b95c2ddf064518121d57e15ffbe76b1f1e1 | 5,575 | py | Python | test/expected/python.tornado/actual_base/ttypes.py | dustyholmes-wf/frugal | 915ccfc58fcc9baabc4549c522e3acd2975a2e0b | [
"Apache-2.0"
] | null | null | null | test/expected/python.tornado/actual_base/ttypes.py | dustyholmes-wf/frugal | 915ccfc58fcc9baabc4549c522e3acd2975a2e0b | [
"Apache-2.0"
] | null | null | null | test/expected/python.tornado/actual_base/ttypes.py | dustyholmes-wf/frugal | 915ccfc58fcc9baabc4549c522e3acd2975a2e0b | [
"Apache-2.0"
] | null | null | null | #
# Autogenerated by Frugal Compiler (3.4.7)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from frugal.util import make_hashable
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol... | 27.463054 | 84 | 0.535785 |
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from frugal.util import make_hashable
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
class base_health_condition(int):
PASS = 1
WARN = 2
FAIL = 3
UNKNOWN = 4
_VA... | true | true |
790d7d696ec7f804417edc31f8fffd6f6e9ddc48 | 26,411 | py | Python | demos/gce_demo.py | atsaki/libcloud | ae85479e835494e196e2f6e79aae9a475603d8ac | [
"Apache-2.0"
] | 3 | 2015-09-11T15:42:16.000Z | 2021-05-12T01:10:05.000Z | demos/gce_demo.py | atsaki/libcloud | ae85479e835494e196e2f6e79aae9a475603d8ac | [
"Apache-2.0"
] | null | null | null | demos/gce_demo.py | atsaki/libcloud | ae85479e835494e196e2f6e79aae9a475603d8ac | [
"Apache-2.0"
] | 3 | 2016-02-08T23:38:18.000Z | 2019-11-05T00:31:34.000Z | #!/usr/bin/env python
# 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 "Licen... | 37.892396 | 78 | 0.613381 |
try:
import argparse
except:
print('This script uses the python "argparse" module. Please use Python '
'2.7 or greater.')
raise
try:
import secrets
except ImportError:
print('"demos/secrets.py" not found.\n\n'
'Please copy secrets.py-dist to secrets.py and ... | false | true |
790d7d7ba0053e639f2f0a33658279ba5db13313 | 3,474 | py | Python | vaccines.py | Karalius/get-vaccine-vilnius | 49a918cdef6fedc7538f7e49210b18fb1f03f7f4 | [
"MIT"
] | null | null | null | vaccines.py | Karalius/get-vaccine-vilnius | 49a918cdef6fedc7538f7e49210b18fb1f03f7f4 | [
"MIT"
] | null | null | null | vaccines.py | Karalius/get-vaccine-vilnius | 49a918cdef6fedc7538f7e49210b18fb1f03f7f4 | [
"MIT"
] | null | null | null | import time
from bs4 import BeautifulSoup
import requests
import json
from datetime import datetime, timedelta
import psycopg2
import smtplib
import os
DATABASE = os.environ["DATABASE"]
USER = os.environ["USER"]
PASSWORD = os.environ["PASSWORD"]
HOST = os.environ["HOST"]
def send_email(message: str)... | 32.46729 | 161 | 0.582614 | import time
from bs4 import BeautifulSoup
import requests
import json
from datetime import datetime, timedelta
import psycopg2
import smtplib
import os
DATABASE = os.environ["DATABASE"]
USER = os.environ["USER"]
PASSWORD = os.environ["PASSWORD"]
HOST = os.environ["HOST"]
def send_email(message: str)... | true | true |
790d7db67280443b19cd4193370f605802115a87 | 847 | py | Python | salt/runners/ssh.py | bogdanr/salt | 4f198525873a1b7da3fbb9994dbb40d381494922 | [
"Apache-2.0"
] | 2 | 2015-08-04T21:54:38.000Z | 2019-04-25T21:47:08.000Z | salt/runners/ssh.py | bogdanr/salt | 4f198525873a1b7da3fbb9994dbb40d381494922 | [
"Apache-2.0"
] | 1 | 2015-09-02T12:49:48.000Z | 2015-09-02T19:22:58.000Z | salt/runners/ssh.py | bogdanr/salt | 4f198525873a1b7da3fbb9994dbb40d381494922 | [
"Apache-2.0"
] | 1 | 2020-10-19T11:49:50.000Z | 2020-10-19T11:49:50.000Z | # -*- coding: utf-8 -*-
'''
A Runner module interface on top of the salt-ssh Python API.
This allows for programmatic use from salt-api, the Reactor, Orchestrate, etc.
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Libs
import salt.client.ssh.client
def cmd(
tgt,
fun,... | 21.175 | 78 | 0.602125 |
from __future__ import absolute_import
import salt.client.ssh.client
def cmd(
tgt,
fun,
arg=(),
timeout=None,
expr_form='glob',
kwarg=None):
client = salt.client.ssh.client.SSHClient(mopts=__opts__)
return client.cmd(
tgt,
fun,
... | true | true |
790d7dc3297a1f9745e929ec6e91dfe5c2d85a35 | 13,991 | py | Python | superset/dashboards/commands/importers/v0.py | Jacob-ru/superset | 148409214ce760368e3bf8122eb0d79297606a0a | [
"Apache-2.0"
] | null | null | null | superset/dashboards/commands/importers/v0.py | Jacob-ru/superset | 148409214ce760368e3bf8122eb0d79297606a0a | [
"Apache-2.0"
] | null | null | null | superset/dashboards/commands/importers/v0.py | Jacob-ru/superset | 148409214ce760368e3bf8122eb0d79297606a0a | [
"Apache-2.0"
] | null | null | null | # 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... | 37.509383 | 99 | 0.67715 |
import json
import logging
import time
from copy import copy
from datetime import datetime
from typing import Any, Dict, Optional
from flask_babel import lazy_gettext as _
from sqlalchemy.orm import make_transient, Session
from superset import ConnectorRegistry, db
from superset.commands.base import B... | true | true |
790d7dd48cc8d6d26ccd217555dd59ffcf548329 | 19,845 | py | Python | nemo/collections/asr/metrics/rnnt_wer.py | Zenodia/NeMo | 3c288d8a7caf667c95444c39434e3ebc5f53d911 | [
"Apache-2.0"
] | null | null | null | nemo/collections/asr/metrics/rnnt_wer.py | Zenodia/NeMo | 3c288d8a7caf667c95444c39434e3ebc5f53d911 | [
"Apache-2.0"
] | null | null | null | nemo/collections/asr/metrics/rnnt_wer.py | Zenodia/NeMo | 3c288d8a7caf667c95444c39434e3ebc5f53d911 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020, NVIDIA CORPORATION. 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/licenses/LICENSE-2.0
#
# Unless required by appli... | 45.308219 | 125 | 0.639153 |
from abc import ABC, abstractmethod
from typing import List, Optional, Union
import editdistance
import torch
from pytorch_lightning.metrics import Metric
from nemo.collections.asr.parts import rnnt_beam_decoding as beam_decode
from nemo.collections.asr.parts import rnnt_greedy_decoding as greedy_decode... | true | true |
790d7ea7e04de4db2eb42eabb7345b913f10bb3e | 3,115 | py | Python | stdplugins/new.py | dqanshi/PornHub | 162a7053ca7f2c0b3617b852559cfaf0502d94a7 | [
"Apache-2.0"
] | 55 | 2019-07-13T15:57:54.000Z | 2021-09-20T16:50:42.000Z | stdplugins/new.py | dqanshi/PornHub | 162a7053ca7f2c0b3617b852559cfaf0502d94a7 | [
"Apache-2.0"
] | 4 | 2020-11-07T07:39:51.000Z | 2020-11-10T03:46:41.000Z | stdplugins/new.py | dqanshi/PornHub | 162a7053ca7f2c0b3617b852559cfaf0502d94a7 | [
"Apache-2.0"
] | 450 | 2019-07-12T13:18:41.000Z | 2022-03-29T18:47:42.000Z | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import string
from telethon import events
from telethon.utils import add_surrogate
from telethon.tl.types import Messag... | 31.464646 | 88 | 0.579775 |
import string
from telethon import events
from telethon.utils import add_surrogate
from telethon.tl.types import MessageEntityPre
from telethon.tl.tlobject import TLObject
import datetime
PRINTABLE_SET = set(bytes(string.printable, 'ascii'))
STR_LEN_MAX = 256
BYTE_LEN_MAX = 64
def parse_pre(text):
text = te... | true | true |
790d7f07d31c0347f7b6720bbb957b85cd61094c | 472 | py | Python | 47 Setters_Property Decorators/main1.py | codewithsandy/Python-Basic-Exp | 4c70ada4a042923a94301453c7bd76e704cd2989 | [
"MIT"
] | 3 | 2021-05-08T13:11:41.000Z | 2021-05-14T02:43:20.000Z | 47 Setters_Property Decorators/main1.py | codewithsandy/Python-Basic-Exp | 4c70ada4a042923a94301453c7bd76e704cd2989 | [
"MIT"
] | null | null | null | 47 Setters_Property Decorators/main1.py | codewithsandy/Python-Basic-Exp | 4c70ada4a042923a94301453c7bd76e704cd2989 | [
"MIT"
] | null | null | null | class Employee:
def __init__(self, fname, lname):
self.fname = fname
self.lname = lname
# self.email = f"{fname}.{lname}@sandy.com"
def explain(self):
return f"This employee is {self.fname} {self.lname}"
def email(self):
return f"{self.fname}.{self.lname} @parker.com... | 24.842105 | 68 | 0.616525 | class Employee:
def __init__(self, fname, lname):
self.fname = fname
self.lname = lname
def explain(self):
return f"This employee is {self.fname} {self.lname}"
def email(self):
return f"{self.fname}.{self.lname} @parker.com"
obj1 = Employee("Peter", "Parkar")
prin... | true | true |
790d7f13e8eacdb2870107a09124364cf34f5df9 | 23,996 | py | Python | h2o-py/dynamic_tests/testdir_algos/glm/pyunit_glm_gaussian_gridsearch_randomdiscrete_large.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2 | 2018-09-20T03:28:46.000Z | 2018-12-06T21:39:29.000Z | h2o-py/dynamic_tests/testdir_algos/glm/pyunit_glm_gaussian_gridsearch_randomdiscrete_large.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2 | 2021-06-02T02:24:03.000Z | 2021-11-15T17:51:49.000Z | h2o-py/dynamic_tests/testdir_algos/glm/pyunit_glm_gaussian_gridsearch_randomdiscrete_large.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 1 | 2020-04-17T13:06:26.000Z | 2020-04-17T13:06:26.000Z | from __future__ import print_function
import sys
import random
import os
from builtins import range
import time
import json
sys.path.insert(1, "../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
from h2o.grid.grid_search import H2OGridSearch
class Test... | 53.324444 | 121 | 0.67257 | from __future__ import print_function
import sys
import random
import os
from builtins import range
import time
import json
sys.path.insert(1, "../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
from h2o.grid.grid_search import H2OGridSearch
class Test... | true | true |
790d7f2469b623df18560268f0e89fc2f0e10bab | 2,558 | py | Python | Good_Boids_module/tests/test_the_Good_Boids.py | anest1s/Refactoring_the_Bad_Boids | d569de4372d96917ef6aa7f1ca8acdaa09c26e0f | [
"MIT"
] | null | null | null | Good_Boids_module/tests/test_the_Good_Boids.py | anest1s/Refactoring_the_Bad_Boids | d569de4372d96917ef6aa7f1ca8acdaa09c26e0f | [
"MIT"
] | null | null | null | Good_Boids_module/tests/test_the_Good_Boids.py | anest1s/Refactoring_the_Bad_Boids | d569de4372d96917ef6aa7f1ca8acdaa09c26e0f | [
"MIT"
] | null | null | null | from Good_Boids_module.Update_Boids import Boids
import numpy as np
from nose.tools import assert_almost_equal, assert_greater
from nose.tools import assert_less, assert_equal
from numpy.testing import assert_array_equal
import os
import yaml
from Good_Boids_module.tests.record_fixtures import configuration_file
fixt... | 51.16 | 108 | 0.788898 | from Good_Boids_module.Update_Boids import Boids
import numpy as np
from nose.tools import assert_almost_equal, assert_greater
from nose.tools import assert_less, assert_equal
from numpy.testing import assert_array_equal
import os
import yaml
from Good_Boids_module.tests.record_fixtures import configuration_file
fixt... | true | true |
790d7fd564a4906d9c3188c0bff4c57844454fd8 | 681 | py | Python | seija/reusables/verification.py | MapsetManagementServer/Seija | 88acafaa311970df5ae881b7eda48ea780a18d03 | [
"MIT"
] | 3 | 2019-07-25T18:27:13.000Z | 2021-11-28T18:51:09.000Z | seija/reusables/verification.py | MapsetManagementServer/Seija | 88acafaa311970df5ae881b7eda48ea780a18d03 | [
"MIT"
] | null | null | null | seija/reusables/verification.py | MapsetManagementServer/Seija | 88acafaa311970df5ae881b7eda48ea780a18d03 | [
"MIT"
] | 6 | 2019-12-17T19:48:10.000Z | 2022-03-11T04:29:06.000Z | import discord
async def get_role_based_on_reputation(self, guild, ranked_amount):
if ranked_amount >= 10:
return await get_role_from_db(self, "experienced_mapper", guild)
elif ranked_amount >= 1:
return await get_role_from_db(self, "ranked_mapper", guild)
else:
return await get_ro... | 37.833333 | 98 | 0.675477 | import discord
async def get_role_based_on_reputation(self, guild, ranked_amount):
if ranked_amount >= 10:
return await get_role_from_db(self, "experienced_mapper", guild)
elif ranked_amount >= 1:
return await get_role_from_db(self, "ranked_mapper", guild)
else:
return await get_ro... | true | true |
790d80d0c914106a10d2850b810eb380fd4604ed | 840 | py | Python | LeetCode/581.py | KevinTMtz/CompetitiveProgramming | 0bf8a297c404073df707b6d7b06965b055ccd872 | [
"MIT"
] | 1 | 2020-12-08T02:01:18.000Z | 2020-12-08T02:01:18.000Z | LeetCode/581.py | KevinTMtz/CompetitiveProgramming | 0bf8a297c404073df707b6d7b06965b055ccd872 | [
"MIT"
] | null | null | null | LeetCode/581.py | KevinTMtz/CompetitiveProgramming | 0bf8a297c404073df707b6d7b06965b055ccd872 | [
"MIT"
] | null | null | null | #
# LeetCode
#
# Problem - 581
# URL - https://leetcode.com/problems/shortest-unsorted-continuous-subarray/
#
class Solution:
def findUnsortedSubarray(self, arr: List[int]) -> int:
if (not arr):
0
index1 = -1
index2 = -1
for i in range(1, len(arr)):
if (arr[i] < arr[i-1]):
index... | 19.534884 | 76 | 0.515476 |
class Solution:
def findUnsortedSubarray(self, arr: List[int]) -> int:
if (not arr):
0
index1 = -1
index2 = -1
for i in range(1, len(arr)):
if (arr[i] < arr[i-1]):
index1 = i-1
break
for i in range(len(arr)-2, -1, -1):
if (arr[i] > arr[i+1]):
ind... | true | true |
790d8113d67e2f8121e30d836a9d637643f5563b | 814 | py | Python | nebula2/gclient/net/__init__.py | xiaoronghuang/nebula-python | fe2a85639dd1500133a63bad50f72b3c0370d1de | [
"Apache-2.0"
] | 110 | 2019-10-24T09:21:07.000Z | 2022-03-31T07:06:00.000Z | nebula2/gclient/net/__init__.py | xiaoronghuang/nebula-python | fe2a85639dd1500133a63bad50f72b3c0370d1de | [
"Apache-2.0"
] | 83 | 2019-11-20T07:55:05.000Z | 2022-03-23T10:55:14.000Z | nebula2/gclient/net/__init__.py | xiaoronghuang/nebula-python | fe2a85639dd1500133a63bad50f72b3c0370d1de | [
"Apache-2.0"
] | 56 | 2019-10-11T07:01:05.000Z | 2022-03-11T09:09:15.000Z | #!/usr/bin/env python
# --coding:utf-8--
# Copyright (c) 2020 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.
import logging
from nebula2.common.ttypes import ErrorCode
from nebula2.Exception im... | 29.071429 | 117 | 0.782555 |
import logging
from nebula2.common.ttypes import ErrorCode
from nebula2.Exception import (
AuthFailedException,
IOErrorException,
NotValidConnectionException,
InValidHostname,
)
from nebula2.data.ResultSet import ResultSet
from nebula2.gclient.net.AuthResult import AuthResult
from nebula2.gc... | true | true |
790d81313101dbd0c7e9056bdded1306b21ca4f5 | 1,586 | py | Python | src/scheduler/models/dao/connection/ConnectionDatabase.py | jedicontributors/pythondataintegrator | 3e877b367ab9b20185476128ec053db41087879f | [
"MIT"
] | 14 | 2020-12-19T15:06:13.000Z | 2022-01-12T19:52:17.000Z | src/scheduler/models/dao/connection/ConnectionDatabase.py | jedicontributors/pythondataintegrator | 3e877b367ab9b20185476128ec053db41087879f | [
"MIT"
] | 43 | 2021-01-06T22:05:22.000Z | 2022-03-10T10:30:30.000Z | src/scheduler/models/dao/connection/ConnectionDatabase.py | jedicontributors/pythondataintegrator | 3e877b367ab9b20185476128ec053db41087879f | [
"MIT"
] | 4 | 2020-12-18T23:10:09.000Z | 2021-04-02T13:03:12.000Z | from sqlalchemy import Column, String, Integer, ForeignKey
from sqlalchemy.orm import relationship
from IocManager import IocManager
from models.dao.Entity import Entity
class ConnectionDatabase(Entity, IocManager.Base):
__tablename__ = "ConnectionDatabase"
__table_args__ = {"schema": "Connection"}
Connec... | 42.864865 | 80 | 0.639344 | from sqlalchemy import Column, String, Integer, ForeignKey
from sqlalchemy.orm import relationship
from IocManager import IocManager
from models.dao.Entity import Entity
class ConnectionDatabase(Entity, IocManager.Base):
__tablename__ = "ConnectionDatabase"
__table_args__ = {"schema": "Connection"}
Connec... | true | true |
790d825980ab768a98f6d16fa5cacee688c8eb00 | 550 | py | Python | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/solitary-morning-29716 | d7672250b446b91af96f5bf0f75838d96d7c5b3a | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/solitary-morning-29716 | d7672250b446b91af96f5bf0f75838d96d7c5b3a | [
"FTL",
"AML",
"RSA-MD"
] | 43 | 2021-08-11T09:52:00.000Z | 2022-02-06T17:28:12.000Z | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/solitary-morning-29716 | d7672250b446b91af96f5bf0f75838d96d7c5b3a | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "solitary-morning-29716.botics.co"
site_params = {
"name": "Solitary Morning",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.objects.... | 21.153846 | 61 | 0.661818 | from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "solitary-morning-29716.botics.co"
site_params = {
"name": "Solitary Morning",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.objects.... | true | true |
790d828e52a2e702df0df87304c75254ba67a0fa | 603 | py | Python | blog/migrations/0001_initial.py | bwarren2/django-basic-blog | 20d4c40f19054d4aa8899240d211781624a7e0c7 | [
"MIT"
] | 1 | 2019-08-14T13:26:24.000Z | 2019-08-14T13:26:24.000Z | blog/migrations/0001_initial.py | bwarren2/django-basic-blog | 20d4c40f19054d4aa8899240d211781624a7e0c7 | [
"MIT"
] | 1 | 2015-07-25T15:23:41.000Z | 2015-07-25T15:23:41.000Z | blog/migrations/0001_initial.py | bwarren2/django-basic-blog | 20d4c40f19054d4aa8899240d211781624a7e0c7 | [
"MIT"
] | 2 | 2015-07-25T01:42:10.000Z | 2019-08-14T13:26:33.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Entry',
fields=[
('id', models.AutoField(verbos... | 24.12 | 114 | 0.538972 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Entry',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=... | true | true |
790d82adcd085ab6a86925542f75f0ad1cbc516c | 2,617 | py | Python | tools/convert.py | tjclement/cz19-badge | 6d04756f61053f2ddd97ed60cfb008393d476721 | [
"MIT"
] | null | null | null | tools/convert.py | tjclement/cz19-badge | 6d04756f61053f2ddd97ed60cfb008393d476721 | [
"MIT"
] | null | null | null | tools/convert.py | tjclement/cz19-badge | 6d04756f61053f2ddd97ed60cfb008393d476721 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import sys
from PIL import Image
import argparse
parser = argparse.ArgumentParser(description='Convert animated or static images to CampZone2019 badge code')
parser.add_argument('image', help='The path to an image to read from (e.g. .gif, .jpg, .png)')
parser.add_argument('--start_x', type=int, def... | 45.912281 | 123 | 0.680168 |
import sys
from PIL import Image
import argparse
parser = argparse.ArgumentParser(description='Convert animated or static images to CampZone2019 badge code')
parser.add_argument('image', help='The path to an image to read from (e.g. .gif, .jpg, .png)')
parser.add_argument('--start_x', type=int, default=0, help='The... | true | true |
790d82f674b469724c789de3e008a86a773eabf8 | 1,670 | py | Python | tools/clean_file_locks.py | bopopescu/extra-specs-1 | 6a14d8d7807727023b4d589af47e8a9605f12db1 | [
"Apache-2.0"
] | null | null | null | tools/clean_file_locks.py | bopopescu/extra-specs-1 | 6a14d8d7807727023b4d589af47e8a9605f12db1 | [
"Apache-2.0"
] | 1 | 2020-07-24T14:14:13.000Z | 2020-07-24T14:14:13.000Z | tools/clean_file_locks.py | bopopescu/extra-specs-1 | 6a14d8d7807727023b4d589af47e8a9605f12db1 | [
"Apache-2.0"
] | 1 | 2020-07-24T10:40:59.000Z | 2020-07-24T10:40:59.000Z | #!/usr/bin/env python
# Copyright 2012 La Honda Research Center, Inc.
#
# 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 ap... | 26.09375 | 74 | 0.713772 |
import logging
import optparse
from nova import flags
from nova import log
from nova import utils
LOG = log.getLogger('nova.utils')
FLAGS = flags.FLAGS
def parse_options():
parser = optparse.OptionParser('usage: %prog [options]')
parser.add_option('--verbose', action='store_true',
... | true | true |
790d832d1bb65414d4f691b248e8be0d69894926 | 458 | py | Python | data/scripts/templates/object/tangible/loot/quest/shared_nym_droid_memory_chip.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/loot/quest/shared_nym_droid_memory_chip.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/loot/quest/shared_nym_droid_memory_chip.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/loot/quest/shared_nym_droid_memory_chip.iff"
result.attribute_templ... | 26.941176 | 80 | 0.731441 | true | true | |
790d83c21c632207c9ab00fc86d6452ee5f648d5 | 3,011 | py | Python | code/logz.py | edwithschoolofai/ARS | 22ec3c58637a84e374611d3f8bf05b89a9468f8a | [
"BSD-2-Clause"
] | 398 | 2018-03-20T07:08:01.000Z | 2022-03-14T05:51:47.000Z | code/logz.py | edwithschoolofai/ARS | 22ec3c58637a84e374611d3f8bf05b89a9468f8a | [
"BSD-2-Clause"
] | 13 | 2018-03-28T19:12:07.000Z | 2021-03-19T03:49:49.000Z | code/logz.py | edwithschoolofai/ARS | 22ec3c58637a84e374611d3f8bf05b89a9468f8a | [
"BSD-2-Clause"
] | 96 | 2018-03-20T21:17:33.000Z | 2021-12-23T02:58:40.000Z | # Code in this file is copied and adapted from
# https://github.com/berkeleydeeprlcourse
import json
"""
Some simple logging functionality, inspired by rllab's logging.
Assumes that each diagnostic gets logged each iteration
Call logz.configure_output_dir() to start logging to a
tab-separated-values file (some_fo... | 28.67619 | 122 | 0.63733 |
import json
import os.path as osp, shutil, time, atexit, os, subprocess
color2num = dict(
gray=30,
red=31,
green=32,
yellow=33,
blue=34,
magenta=35,
cyan=36,
white=37,
crimson=38
)
def colorize(string, color, bold=False, highlight=False):
attr = []
num = color2num[colo... | true | true |
790d848466bbf50695151b9cdec24f3f85cd12db | 24,285 | py | Python | src/image-gallery/azext_image_gallery/vendored_sdks/azure_mgmt_compute/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | src/image-gallery/azext_image_gallery/vendored_sdks/azure_mgmt_compute/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 9 | 2022-03-25T19:35:49.000Z | 2022-03-31T06:09:47.000Z | src/image-gallery/azext_image_gallery/vendored_sdks/azure_mgmt_compute/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 1 | 2022-03-10T22:13:02.000Z | 2022-03-10T22:13:02.000Z | # pylint: disable=too-many-lines
# 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) AutoRe... | 44.154545 | 234 | 0.680255 |
from typing import Any, Callable, Dict, Optional, TypeVar, Union
from msrest import Serializer
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transpo... | true | true |
790d87bd4bdeedbce5f096b24423ab2e051374d9 | 122 | py | Python | api/uploader/__init__.py | StepaTa/vkbottle | 3b04a5343380cbabe782151e7cb1c1645a9fa9ce | [
"MIT"
] | null | null | null | api/uploader/__init__.py | StepaTa/vkbottle | 3b04a5343380cbabe782151e7cb1c1645a9fa9ce | [
"MIT"
] | null | null | null | api/uploader/__init__.py | StepaTa/vkbottle | 3b04a5343380cbabe782151e7cb1c1645a9fa9ce | [
"MIT"
] | null | null | null | from .base import Uploader
from .photo import PhotoUploader
from .doc import DocUploader
from .audio import AudioUploader
| 24.4 | 32 | 0.836066 | from .base import Uploader
from .photo import PhotoUploader
from .doc import DocUploader
from .audio import AudioUploader
| true | true |
790d881362b5d343de0d5f2fd2d6938e5126cc81 | 12,685 | py | Python | python_modules/dagster/dagster/core/code_pointer.py | mpkocher/dagster | c25c07de0e9259b08d6227f82d7aaa24f23bee85 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/code_pointer.py | mpkocher/dagster | c25c07de0e9259b08d6227f82d7aaa24f23bee85 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/code_pointer.py | mpkocher/dagster | c25c07de0e9259b08d6227f82d7aaa24f23bee85 | [
"Apache-2.0"
] | null | null | null | import importlib
import inspect
import os
import sys
import warnings
from abc import ABCMeta, abstractmethod
from collections import namedtuple
import six
from dagster import check
from dagster.core.errors import DagsterInvariantViolationError
from dagster.serdes import whitelist_for_serdes
from dagster.seven import ... | 39.030769 | 100 | 0.659361 | import importlib
import inspect
import os
import sys
import warnings
from abc import ABCMeta, abstractmethod
from collections import namedtuple
import six
from dagster import check
from dagster.core.errors import DagsterInvariantViolationError
from dagster.serdes import whitelist_for_serdes
from dagster.seven import ... | true | true |
790d886400acb4a4a179d95f684170cd908e401b | 4,777 | py | Python | metrics/__init__.py | nathan-bennett/skellam | 8a1fff14ac8c5f6bd415a51befab818f864ab3e5 | [
"Apache-2.0"
] | null | null | null | metrics/__init__.py | nathan-bennett/skellam | 8a1fff14ac8c5f6bd415a51befab818f864ab3e5 | [
"Apache-2.0"
] | null | null | null | metrics/__init__.py | nathan-bennett/skellam | 8a1fff14ac8c5f6bd415a51befab818f864ab3e5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import numpy as np
import scipy
from shared_utils import ArrayUtils
class SkellamMetrics:
def __init__(self, x_metrics, y_metrics, y_hat, model, l0, l1, training_values):
self._y = y_metrics
self._y_hat = y_hat
self.model = model
self.l0 = ArrayUtils.convert_t... | 38.524194 | 119 | 0.639941 |
import numpy as np
import scipy
from shared_utils import ArrayUtils
class SkellamMetrics:
def __init__(self, x_metrics, y_metrics, y_hat, model, l0, l1, training_values):
self._y = y_metrics
self._y_hat = y_hat
self.model = model
self.l0 = ArrayUtils.convert_to_array(l0)
s... | true | true |
790d890e572f0484dc39deb4959d6eb47614406d | 1,683 | py | Python | compecon/demos/demddp04.py | daniel-schaefer/CompEcon-python | d3f66e04a7e02be648fc5a68065806ec7cc6ffd6 | [
"MIT"
] | 23 | 2016-12-14T13:21:27.000Z | 2020-08-23T21:04:34.000Z | compecon/demos/demddp04.py | daniel-schaefer/CompEcon-python | d3f66e04a7e02be648fc5a68065806ec7cc6ffd6 | [
"MIT"
] | 1 | 2017-09-10T04:48:54.000Z | 2018-03-31T01:36:46.000Z | compecon/demos/demddp04.py | daniel-schaefer/CompEcon-python | d3f66e04a7e02be648fc5a68065806ec7cc6ffd6 | [
"MIT"
] | 13 | 2017-02-25T08:10:38.000Z | 2020-05-15T09:49:16.000Z | __author__ = 'Randall'
from demos.setup import np, plt, demo
from compecon import DDPmodel
# DEMDDP04 Binomial American put option model
# Model Parameters
T = 0.5 # years to expiration
sigma = 0.2 # annual volatility
r = 0.05 # annual interest rate
strike = 2.1 ... | 29.017241 | 86 | 0.59893 | __author__ = 'Randall'
from demos.setup import np, plt, demo
from compecon import DDPmodel
T = 0.5
sigma = 0.2
r = 0.05
strike = 2.1
p0 = 2.0
N = 100
tau = T / N
delta = np.exp(-r * tau)
u = np... | true | true |
790d89446cea7063ba034aae3075bfd56fe8dac1 | 11,029 | py | Python | benchmarks/crypto.py | codeclimate-testing/falcon | c2d0b9da4d4cffd39cd489ffa886ee745d06f063 | [
"Apache-2.0"
] | 115 | 2015-01-18T13:28:05.000Z | 2022-03-01T23:45:44.000Z | benchmarks/crypto.py | codeclimate-testing/falcon | c2d0b9da4d4cffd39cd489ffa886ee745d06f063 | [
"Apache-2.0"
] | null | null | null | benchmarks/crypto.py | codeclimate-testing/falcon | c2d0b9da4d4cffd39cd489ffa886ee745d06f063 | [
"Apache-2.0"
] | 8 | 2015-02-12T04:08:42.000Z | 2018-09-11T20:55:29.000Z | """
A pure python (slow) implementation of rijndael with a decent interface
To include -
from rijndael import rijndael
To do a key setup -
r = rijndael(key, block_size = 16)
key must be a string of length 16, 24, or 32
blocksize must be 16, 24, or 32. Default is 16
To use -
ciphertext = r.encrypt(plaintext)
plai... | 28.871728 | 117 | 0.430683 |
import copy
import string
shifts = [[[0, 0], [1, 3], [2, 2], [3, 1]],
[[0, 0], [1, 5], [2, 4], [3, 3]],
[[0, 0], [1, 7], [3, 5], [4, 4]]]
num_rounds = {16: {16: 10, 24: 12, 32: 14}, 24: {16: 12, 24: 12, 32: 14}, 32: {16: 14, 24: 14, 32: 14}}
A = [[1, 1, 1, 1, 1, 0, 0, 0],
[0, 1, 1, 1... | true | true |
790d894ac649eab4e1f3c6ca5bc2cad193bdd4e5 | 19,599 | py | Python | tests/unit/test_validators/test_linearity_validator.py | abxsantos/analytical-validation-backend | 1ea980f17be10562f2b9e9db384076374f445642 | [
"MIT"
] | null | null | null | tests/unit/test_validators/test_linearity_validator.py | abxsantos/analytical-validation-backend | 1ea980f17be10562f2b9e9db384076374f445642 | [
"MIT"
] | 6 | 2021-03-20T04:28:03.000Z | 2022-01-21T20:32:07.000Z | tests/unit/test_validators/test_linearity_validator.py | abxsantos/analytical-validation-backend | 1ea980f17be10562f2b9e9db384076374f445642 | [
"MIT"
] | null | null | null | from unittest.mock import call, PropertyMock, MagicMock
import pytest
from analytical_validation.exceptions import DataWasNotFitted
from src.analytical_validation.validators.linearity_validator import LinearityValidator
@pytest.fixture(scope='function')
def fitted_result_obj(mocker):
mock = mocker.Mock(create=T... | 54.140884 | 222 | 0.643247 | from unittest.mock import call, PropertyMock, MagicMock
import pytest
from analytical_validation.exceptions import DataWasNotFitted
from src.analytical_validation.validators.linearity_validator import LinearityValidator
@pytest.fixture(scope='function')
def fitted_result_obj(mocker):
mock = mocker.Mock(create=T... | true | true |
790d89b051ad928e9d6e848f5756aacde4baebf3 | 1,049 | py | Python | xlsxwriter/test/comparison/test_comment06.py | dthadi3/XlsxWriter | f1801e82240aa9c746ce14948ef95990b83162cf | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2020-07-01T07:24:37.000Z | 2020-07-01T07:24:37.000Z | xlsxwriter/test/comparison/test_comment06.py | dthadi3/XlsxWriter | f1801e82240aa9c746ce14948ef95990b83162cf | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_comment06.py | dthadi3/XlsxWriter | f1801e82240aa9c746ce14948ef95990b83162cf | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2020, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | 26.225 | 79 | 0.618684 | true | true | |
790d8a145788a182d3cee1348ee6a22e7eba58ed | 3,354 | py | Python | google-cloud-sdk/lib/googlecloudsdk/core/diagnostics/diagnostic_base.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/lib/googlecloudsdk/core/diagnostics/diagnostic_base.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/lib/googlecloudsdk/core/diagnostics/diagnostic_base.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 3 | 2017-07-27T18:44:13.000Z | 2020-07-25T17:48:53.000Z | # Copyright 2016 Google Inc. 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 33.207921 | 79 | 0.699463 |
from googlecloudsdk.core import log
from googlecloudsdk.core import properties
from googlecloudsdk.core.console import progress_tracker
class Diagnostic(object):
_MAX_RETRIES = 5
def __init__(self, intro, title, checklist):
self.intro = intro
self.title = title
self.checklist = checkl... | true | true |
790d8aa3dd20e63992a5022c4c718a8f25bcdb4a | 371 | py | Python | doc/for_dev/scikit-image/setup_codes/cmorph__dilate.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | doc/for_dev/scikit-image/setup_codes/cmorph__dilate.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | doc/for_dev/scikit-image/setup_codes/cmorph__dilate.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | import numpy as np
from future.cmorph import _dilate
rows = 1024
cols = 1024
srows = 64
scols = 64
image = np.random.randint(0, 255, rows * cols, dtype=np.uint8).reshape(
(rows, cols)
)
selem = np.random.randint(0, 1, srows * scols, dtype=np.uint8).reshape(
(srows, scols)
)
out = np.zeros((rows, cols), dtype=... | 21.823529 | 71 | 0.679245 | import numpy as np
from future.cmorph import _dilate
rows = 1024
cols = 1024
srows = 64
scols = 64
image = np.random.randint(0, 255, rows * cols, dtype=np.uint8).reshape(
(rows, cols)
)
selem = np.random.randint(0, 1, srows * scols, dtype=np.uint8).reshape(
(srows, scols)
)
out = np.zeros((rows, cols), dtype=... | true | true |
790d8c973d8f3371872a0ff0b9877108bc43a039 | 622 | py | Python | sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/aio/operations_async/__init__.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2019-05-17T21:24:53.000Z | 2020-02-12T11:13:42.000Z | sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/aio/operations_async/__init__.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/aio/operations_async/__init__.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # 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 ... | 38.875 | 94 | 0.588424 |
from ._vaults_operations_async import VaultsOperations
from ._operations_async import Operations
__all__ = [
'VaultsOperations',
'Operations',
]
| true | true |
790d8d10c93b27d59e0cddbc0638ac05326fbd57 | 3,359 | py | Python | djng/middleware.py | shriDeveloper/django-angular | b32a910b0e154e5707a10fe3e58de1542fd4183b | [
"MIT"
] | 1 | 2020-01-09T12:18:59.000Z | 2020-01-09T12:18:59.000Z | djng/middleware.py | shriDeveloper/django-angular | b32a910b0e154e5707a10fe3e58de1542fd4183b | [
"MIT"
] | null | null | null | djng/middleware.py | shriDeveloper/django-angular | b32a910b0e154e5707a10fe3e58de1542fd4183b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import six
from django import http
from django.urls import reverse
from django.utils.http import unquote
try:
from django.utils.deprecation import MiddlewareMixin
except ImportError:
MiddlewareMixin = object
class AngularUrlMiddleware(MiddlewareM... | 45.391892 | 116 | 0.650789 |
from __future__ import unicode_literals
import six
from django import http
from django.urls import reverse
from django.utils.http import unquote
try:
from django.utils.deprecation import MiddlewareMixin
except ImportError:
MiddlewareMixin = object
class AngularUrlMiddleware(MiddlewareMixin):
ANGULAR_REVE... | true | true |
790d8d6c49aacc1ce2a70311d3da94451ba61e50 | 1,214 | py | Python | Toolz/sqlmap/tamper/charunicodeescape.py | thezakman/CTF-Toolz | b369246ea6766165cce0852e537fb6a0c970869b | [
"Unlicense"
] | 71 | 2019-02-02T11:38:46.000Z | 2022-03-31T14:08:27.000Z | tools/sqlmap/tamper/charunicodeescape.py | sravani-m/Web-Application-Security-Framework | d9f71538f5cba6fe1d8eabcb26c557565472f6a6 | [
"MIT"
] | null | null | null | tools/sqlmap/tamper/charunicodeescape.py | sravani-m/Web-Application-Security-Framework | d9f71538f5cba6fe1d8eabcb26c557565472f6a6 | [
"MIT"
] | 15 | 2019-08-07T06:32:04.000Z | 2022-03-09T12:48:20.000Z | #!/usr/bin/env python
"""
Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""
import string
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.NORMAL
def tamper(payload, **kwargs):
"""
Unicode-escapes non-encoded characters in a given pa... | 30.35 | 213 | 0.57084 |
import string
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.NORMAL
def tamper(payload, **kwargs):
retVal = payload
if payload:
retVal = ""
i = 0
while i < len(payload):
if payload[i] == '%' and (i < len(payload) - 2) and payload[i + 1:i + 2] in string.h... | true | true |
790d8d88be5c0cc63cebc70f5ce66d0a202515c4 | 3,957 | py | Python | tests/lib/copy_engines/test_bbcp_copier.py | SVilgelm/CloudFerry | 4459c0d21ba7ccffe51176932197b352e426ba63 | [
"Apache-2.0"
] | 6 | 2017-04-20T00:49:49.000Z | 2020-12-20T16:27:10.000Z | tests/lib/copy_engines/test_bbcp_copier.py | SVilgelm/CloudFerry | 4459c0d21ba7ccffe51176932197b352e426ba63 | [
"Apache-2.0"
] | 3 | 2017-04-08T15:47:16.000Z | 2017-05-18T17:40:59.000Z | tests/lib/copy_engines/test_bbcp_copier.py | SVilgelm/CloudFerry | 4459c0d21ba7ccffe51176932197b352e426ba63 | [
"Apache-2.0"
] | 8 | 2017-04-07T23:42:36.000Z | 2021-08-10T11:05:10.000Z | # Copyright (c) 2016 Mirantis Inc.
#
# 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, so... | 39.969697 | 79 | 0.682841 |
import mock
from cloudferry.lib.copy_engines import base
from cloudferry.lib.copy_engines import bbcp_copier
from cloudferry.lib.utils import remote_runner
from tests.lib.copy_engines import test_base
from tests import test
class BbcpCopierTestCase(test_base.BaseTestCase):
copier_class = bbcp_copie... | true | true |
790d8e57faed3e19d353ef1b42ede6c299f99f05 | 66 | py | Python | src/pomodoro/__main__.py | Dev3XOR/pomodoro | d4dc48b6ebb86ebcccf0897faac7bba36d0319aa | [
"MIT"
] | null | null | null | src/pomodoro/__main__.py | Dev3XOR/pomodoro | d4dc48b6ebb86ebcccf0897faac7bba36d0319aa | [
"MIT"
] | 1 | 2021-12-17T22:24:00.000Z | 2021-12-17T22:24:00.000Z | src/pomodoro/__main__.py | Dev3XOR/pomodoro | d4dc48b6ebb86ebcccf0897faac7bba36d0319aa | [
"MIT"
] | null | null | null | from pomodoro import main
if __name__ == "__main__":
main()
| 11 | 26 | 0.666667 | from pomodoro import main
if __name__ == "__main__":
main()
| true | true |
790d8e8aea11def00cbaffc91e9868fda5dc192f | 568 | py | Python | src/fidalgo/azext_fidalgo/generated/_params.py | tbyfield/azure-cli-extensions | e7e5f37fdcea3afb5c4aecb61fa72eac72c2128e | [
"MIT"
] | null | null | null | src/fidalgo/azext_fidalgo/generated/_params.py | tbyfield/azure-cli-extensions | e7e5f37fdcea3afb5c4aecb61fa72eac72c2128e | [
"MIT"
] | null | null | null | src/fidalgo/azext_fidalgo/generated/_params.py | tbyfield/azure-cli-extensions | e7e5f37fdcea3afb5c4aecb61fa72eac72c2128e | [
"MIT"
] | 1 | 2022-02-14T21:43:29.000Z | 2022-02-14T21:43:29.000Z | # --------------------------------------------------------------------------
# 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 cause incor... | 37.866667 | 76 | 0.558099 |
def load_arguments(self, _):
pass
| true | true |
790d8ed36d68e07e09425d5ec08df55d0d2d55e4 | 338 | py | Python | tests/devices/eiger/test_eiger_status.py | dls-controls/tickit | 00bb013e69674bcfe4926f365ecb3c65c080abe8 | [
"Apache-2.0"
] | 4 | 2021-09-16T13:35:33.000Z | 2022-02-01T23:35:53.000Z | tests/devices/eiger/test_eiger_status.py | dls-controls/tickit | 00bb013e69674bcfe4926f365ecb3c65c080abe8 | [
"Apache-2.0"
] | 46 | 2021-09-16T13:44:58.000Z | 2022-02-02T13:42:56.000Z | tests/devices/eiger/test_eiger_status.py | dls-controls/tickit | 00bb013e69674bcfe4926f365ecb3c65c080abe8 | [
"Apache-2.0"
] | null | null | null | import pytest
from tickit.devices.eiger.eiger_status import EigerStatus
# # # # # EigerStatus Tests # # # # #
@pytest.fixture
def eiger_status() -> EigerStatus:
return EigerStatus()
def test_eiger_status_constructor():
EigerStatus()
def test_eiger_status_getitem(eiger_status):
assert 24.5 == eiger_s... | 17.789474 | 57 | 0.730769 | import pytest
from tickit.devices.eiger.eiger_status import EigerStatus
status_getitem(eiger_status):
assert 24.5 == eiger_status["th0_temp"]
| true | true |
790d8ed41339bba225986addcf060058eecda9c0 | 5,645 | py | Python | cogrob_ros/cogrob_pololu_lidar/scripts/cogrob_pololu_lidar.py | CogRob/TritonBot | d05b521ec7a7f54a04409f5a2897f3e5c75fd3bf | [
"BSD-3-Clause"
] | 8 | 2018-09-21T09:56:02.000Z | 2021-07-26T14:35:14.000Z | cogrob_ros/cogrob_pololu_lidar/scripts/cogrob_pololu_lidar.py | CogRob/TritonBot | d05b521ec7a7f54a04409f5a2897f3e5c75fd3bf | [
"BSD-3-Clause"
] | null | null | null | cogrob_ros/cogrob_pololu_lidar/scripts/cogrob_pololu_lidar.py | CogRob/TritonBot | d05b521ec7a7f54a04409f5a2897f3e5c75fd3bf | [
"BSD-3-Clause"
] | 4 | 2018-08-26T21:44:52.000Z | 2019-08-22T07:38:08.000Z | #!/usr/bin/env python
# Copyright (c) 2018, The Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above cop... | 33.205882 | 79 | 0.692117 |
import math
import serial
import sys
import threading
import rospy
import std_msgs.msg
import tf
class PololuSerial(object):
def __init__(self, tty_device='/dev/ttyACM0'):
self._serial = serial.Serial(tty_device, timeout=0.2)
self._lock = threading.Lock()
def _SendCommand(se... | true | true |
790d8edc8ab2aa68079caa33608fed0c6a069a7b | 2,216 | py | Python | src/py-opentimelineio/opentimelineio/algorithms/timeline_algo.py | desruie/OpenTimelineIO | 918797b00e840b7de8a15a3b1ab51e35a004c50f | [
"Apache-2.0"
] | 1,021 | 2017-07-29T05:50:20.000Z | 2022-03-28T16:53:28.000Z | src/py-opentimelineio/opentimelineio/algorithms/timeline_algo.py | desruie/OpenTimelineIO | 918797b00e840b7de8a15a3b1ab51e35a004c50f | [
"Apache-2.0"
] | 987 | 2017-08-01T17:14:57.000Z | 2022-03-31T22:49:03.000Z | src/py-opentimelineio/opentimelineio/algorithms/timeline_algo.py | reinecke/OpenTimelineIO | 1325927157564989952edf7c5f7c317fb90e1288 | [
"Apache-2.0"
] | 233 | 2017-07-28T23:27:10.000Z | 2022-03-31T10:40:35.000Z | #
# Copyright Contributors to the OpenTimelineIO project
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and rep... | 38.877193 | 79 | 0.733303 |
import copy
from . import (
track_algo
)
def timeline_trimmed_to_range(in_timeline, trim_range):
new_timeline = copy.deepcopy(in_timeline)
for track_num, child_track in enumerate(in_timeline.tracks):
new_timeline.tra... | true | true |
790d8fb9ce171e31e7cff74bd1b470c81d27f126 | 4,809 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20200301/get_network_interface_tap_configuration.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/v20200301/get_network_interface_tap_configuration.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/v20200301/get_network_interface_tap_configuration.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 39.743802 | 180 | 0.680183 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetNetworkInterfaceTapConfigurationResult',
'AwaitableGetNetworkInterfaceTapConfigurationResult',
'get_network_interface_... | true | true |
790d907ce96067c105d27b4ff18d5cd849620ec7 | 142 | py | Python | tests/functions.py | apragacz/functoolsplus | 9d26666a2d017b25dd0e031ddde1570f5a4bffd3 | [
"MIT"
] | 2 | 2019-03-01T15:09:16.000Z | 2021-01-26T15:18:58.000Z | tests/functions.py | apragacz/functoolsplus | 9d26666a2d017b25dd0e031ddde1570f5a4bffd3 | [
"MIT"
] | null | null | null | tests/functions.py | apragacz/functoolsplus | 9d26666a2d017b25dd0e031ddde1570f5a4bffd3 | [
"MIT"
] | null | null | null | def identity(x):
return x
def always_false(x):
return False
def always_true(x):
return True
def add(x, y):
return x + y
| 9.466667 | 20 | 0.612676 | def identity(x):
return x
def always_false(x):
return False
def always_true(x):
return True
def add(x, y):
return x + y
| true | true |
790d90b0c4b8b17bedcb8e7ece4b102f0eef8c66 | 2,740 | py | Python | ghwiz/mshp.py | nerdralph/h2k | 187534da4ec1ffb8711e738acd0271b5d3c7a261 | [
"MIT"
] | null | null | null | ghwiz/mshp.py | nerdralph/h2k | 187534da4ec1ffb8711e738acd0271b5d3c7a261 | [
"MIT"
] | null | null | null | ghwiz/mshp.py | nerdralph/h2k | 187534da4ec1ffb8711e738acd0271b5d3c7a261 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# configure mini-split heat pumps for E files
# uses NRCan CSV list converted to TSV
# https://oee.nrcan.gc.ca/pml-lmp/index.cfm?language_langue=en&action=app.search-recherche&appliance=ASHP2_GH
import math, os, sys
import xml.etree.ElementTree as ET
if len(sys.argv) < 3:
print(sys.argv[0], "E-f... | 36.533333 | 373 | 0.693796 |
import math, os, sys
import xml.etree.ElementTree as ET
if len(sys.argv) < 3:
print(sys.argv[0], "E-file.h2k AHRI heads|0(ducted)")
sys.exit()
e_file = sys.argv[1]
ahri = sys.argv[2]
heads = sys.argv[3]
t = ET.parse(e_file)
cchp_search = "grep '" + ahri + "' ccashp.tsv"
d = os.popen(cchp_search).rea... | true | true |
790d926797199d18bc0487056b852ac06c0b6295 | 3,280 | py | Python | tests/conftest.py | elin1231/htmap | b9c43ec1d86e90730210c3317409b75595061d91 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | elin1231/htmap | b9c43ec1d86e90730210c3317409b75595061d91 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | elin1231/htmap | b9c43ec1d86e90730210c3317409b75595061d91 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 HTCondor Team, Computer Sciences Department,
# University of Wisconsin-Madison, WI.
#
# 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/LICE... | 23.941606 | 84 | 0.721341 |
import time
from pathlib import Path
from copy import copy
import pytest
import htmap
from htmap.settings import BASE_SETTINGS
from htmap._startup import ensure_htmap_dir_exists
htmap.settings.replace(BASE_SETTINGS)
htmap.settings[
"DELIVERY_METHOD"
] = "shared"
htmap.settings["WAIT_TIME"] = 0... | true | true |
790d9292ec96dd030beb02589ad7db47a61fdcc8 | 9,395 | py | Python | yyskmultilearn/cluster/graphtool.py | yuan776/scikit-multilearn | 5ad32df237e6a9746fd5ec2f9543dcd011e8cdd2 | [
"BSD-2-Clause"
] | null | null | null | yyskmultilearn/cluster/graphtool.py | yuan776/scikit-multilearn | 5ad32df237e6a9746fd5ec2f9543dcd011e8cdd2 | [
"BSD-2-Clause"
] | null | null | null | yyskmultilearn/cluster/graphtool.py | yuan776/scikit-multilearn | 5ad32df237e6a9746fd5ec2f9543dcd011e8cdd2 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import graph_tool.all as gt
import numpy as np
from .base import LabelGraphClustererBase
from .helpers import _membership_to_list_of_communities, _overlapping_membership_to_list_of_communities
class StochasticBlockModel:
"""A Stochastic... | 36.699219 | 115 | 0.673018 | from __future__ import absolute_import
from __future__ import print_function
import graph_tool.all as gt
import numpy as np
from .base import LabelGraphClustererBase
from .helpers import _membership_to_list_of_communities, _overlapping_membership_to_list_of_communities
class StochasticBlockModel:
def __init__(se... | true | true |
790d9370983b4903b988e873a086e753013d1ced | 5,724 | py | Python | src/djangoreactredux/djrenv/lib/python3.5/site-packages/faker/providers/address/sv_SE/__init__.py | m2jobe/c_x | ba914449a9a85d82703895fc884733ca20454034 | [
"MIT"
] | 9 | 2018-03-29T18:41:22.000Z | 2021-03-11T23:35:30.000Z | faker/providers/address/sv_SE/__init__.py | Saber-xxf/faker1 | c966a144b370f7abb568a5154c4ef704e846722e | [
"MIT"
] | 5 | 2020-03-24T16:37:25.000Z | 2021-06-10T21:24:54.000Z | faker/providers/address/sv_SE/__init__.py | Saber-xxf/faker1 | c966a144b370f7abb568a5154c4ef704e846722e | [
"MIT"
] | 1 | 2018-04-05T22:07:48.000Z | 2018-04-05T22:07:48.000Z | # coding=utf-8
from __future__ import unicode_literals
from .. import Provider as AddressProvider
class Provider(AddressProvider):
building_number_formats = ('###', '##', '#')
street_name_formats = ('{{street_prefix}}{{street_suffix}}', )
street_address_formats = ('{{street_name}} {{building_number}}'... | 51.567568 | 80 | 0.599581 |
from __future__ import unicode_literals
from .. import Provider as AddressProvider
class Provider(AddressProvider):
building_number_formats = ('###', '##', '#')
street_name_formats = ('{{street_prefix}}{{street_suffix}}', )
street_address_formats = ('{{street_name}} {{building_number}}',)
street... | true | true |
790d944fc3cfeccd57e1e4f48ccc80a1c326b3c3 | 11,935 | py | Python | kuka_driver/src/kuka_driver/kuka_rsi_router.py | adamleon/kuka | cac2880ff9bf1fb798029280a9baf51450195fc4 | [
"BSD-3-Clause"
] | null | null | null | kuka_driver/src/kuka_driver/kuka_rsi_router.py | adamleon/kuka | cac2880ff9bf1fb798029280a9baf51450195fc4 | [
"BSD-3-Clause"
] | null | null | null | kuka_driver/src/kuka_driver/kuka_rsi_router.py | adamleon/kuka | cac2880ff9bf1fb798029280a9baf51450195fc4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2014, Norwegian University of Science and Technology
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the ab... | 43.242754 | 130 | 0.600335 |
import socket
import threading
import time
import numpy as np
import struct
import xml.etree.ElementTree as et
class UDPServerRealTime(threading.Thread):
def __init__(self,name, host, port, handshake=None):
threading.Thread.__init__(self)
self.daemon = True
... | false | true |
790d946125e1389709ed26de240d8d12a5c217e1 | 1,087 | py | Python | ML-in-Action/MachineLearning-dev/src/py3.x/ML/15.BigData_MapReduce/mrMeanMapper.py | cherisyu/ML_in_Action | 8c1019de911e7fb1bbab973067213f5f62ab9dcd | [
"Apache-2.0"
] | 1 | 2019-01-23T01:47:31.000Z | 2019-01-23T01:47:31.000Z | ML-in-Action/MachineLearning-dev/src/py3.x/ML/15.BigData_MapReduce/mrMeanMapper.py | cherisyu/ML_in_Action | 8c1019de911e7fb1bbab973067213f5f62ab9dcd | [
"Apache-2.0"
] | null | null | null | ML-in-Action/MachineLearning-dev/src/py3.x/ML/15.BigData_MapReduce/mrMeanMapper.py | cherisyu/ML_in_Action | 8c1019de911e7fb1bbab973067213f5f62ab9dcd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# coding:utf-8
'''
Created on 2017-04-06
Update on 2017-11-17
Author: Peter/ApacheCN-xy/片刻
GitHub: https://github.com/apachecn/MachineLearning
'''
import sys
from numpy import mat, mean, power
'''
这个mapper文件按行读取所有的输入并创建一组对应的浮点数,然后得到数组的长度并创建NumPy矩阵。
再对所有的值进行平方,最后将均值和平方后的均值发送出去。这些值将用来计算全局的均值... | 26.512195 | 78 | 0.677093 |
import sys
from numpy import mat, mean, power
def read_input(file):
for line in file:
yield line.rstrip()
input = read_input(sys.stdin)
input = [float(line) for line in input]
numInputs = len(input)
input = mat(input)
sqInput = po... | true | true |
790d94786a3272ddf89bf0cd9092ab9ab9a52f2a | 2,337 | py | Python | dependencies/generate maps/pythongis/app/tk2/_othermisc/dropdown_works.py | karimbahgat/AutoMap | eae52f16b7ce71cb2b4b7ae67cf6e4680ea2194f | [
"MIT"
] | 4 | 2015-12-05T14:31:55.000Z | 2018-02-09T05:54:36.000Z | dependencies/generate maps/pythongis/app/tk2/_othermisc/dropdown_works.py | karimbahgat/AutoMap | eae52f16b7ce71cb2b4b7ae67cf6e4680ea2194f | [
"MIT"
] | 1 | 2022-01-13T02:52:09.000Z | 2022-01-13T02:52:09.000Z | dependencies/generate maps/pythongis/app/tk2/_othermisc/dropdown_works.py | karimbahgat/AutoMap | eae52f16b7ce71cb2b4b7ae67cf6e4680ea2194f | [
"MIT"
] | 1 | 2018-10-24T01:08:11.000Z | 2018-10-24T01:08:11.000Z |
import Tkinter as tk
class Combobox(tk.Label):
def __init__(self, master, choices=[], default=None, direction="down", arrowimage="default", **kwargs):
style = {"relief": "groove", "bg":"white"}
style.update(kwargs)
tk.Label.__init__(self, master, **style)
# options
if direc... | 35.953846 | 107 | 0.595208 |
import Tkinter as tk
class Combobox(tk.Label):
def __init__(self, master, choices=[], default=None, direction="down", arrowimage="default", **kwargs):
style = {"relief": "groove", "bg":"white"}
style.update(kwargs)
tk.Label.__init__(self, master, **style)
if direction not ... | true | true |
790d953aa8005e2273ab5dd9fc378123efc23152 | 474 | py | Python | sentence_transformers/losses/__init__.py | WHU-Peter/sentence-transformers | a9acd9e8eb086221c1351ad6489ed29a076ca8f5 | [
"Apache-2.0"
] | null | null | null | sentence_transformers/losses/__init__.py | WHU-Peter/sentence-transformers | a9acd9e8eb086221c1351ad6489ed29a076ca8f5 | [
"Apache-2.0"
] | null | null | null | sentence_transformers/losses/__init__.py | WHU-Peter/sentence-transformers | a9acd9e8eb086221c1351ad6489ed29a076ca8f5 | [
"Apache-2.0"
] | null | null | null | from .CosineSimilarityLoss import *
from .SoftmaxLoss import *
from .MultipleNegativesRankingLoss import *
from .TripletLoss import *
from .MSELoss import *
from .ContrastiveLoss import *
from .OnlineContrastiveLoss import *
from .MegaBatchMarginLoss import *
from .DenoisingAutoEncoderLoss import *
# Triplet losses
fr... | 31.6 | 45 | 0.827004 | from .CosineSimilarityLoss import *
from .SoftmaxLoss import *
from .MultipleNegativesRankingLoss import *
from .TripletLoss import *
from .MSELoss import *
from .ContrastiveLoss import *
from .OnlineContrastiveLoss import *
from .MegaBatchMarginLoss import *
from .DenoisingAutoEncoderLoss import *
from .BatchHardTri... | true | true |
790d973791541e76f2855f405878a763b947f1a2 | 8,733 | py | Python | packages/structural_dhcp_mriqc/structural_dhcp_mriqc/qc/functional.py | amakropoulos/structural-pipeline-measures | 70e22f9ad94cc57e72e510576cfc3129da83f7fc | [
"Apache-2.0"
] | 2 | 2017-09-11T15:25:14.000Z | 2019-09-27T17:08:31.000Z | packages/structural_dhcp_mriqc/structural_dhcp_mriqc/qc/functional.py | amakropoulos/structural-pipeline-measures | 70e22f9ad94cc57e72e510576cfc3129da83f7fc | [
"Apache-2.0"
] | 6 | 2019-08-22T06:29:45.000Z | 2021-09-19T18:59:46.000Z | packages/structural_dhcp_mriqc/structural_dhcp_mriqc/qc/functional.py | amakropoulos/structural-pipeline-measures | 70e22f9ad94cc57e72e510576cfc3129da83f7fc | [
"Apache-2.0"
] | 1 | 2018-02-12T14:38:33.000Z | 2018-02-12T14:38:33.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
# pylint: disable=no-member
#
# @Author: oesteban
# @Date: 2016-02-23 19:25:39
# @Email: code@oscaresteban.es
# @Last Modified by: oesteban
# @Last Modifie... | 31.078292 | 89 | 0.620749 |
import os.path as op
import numpy as np
import nibabel as nb
from nitime import algorithms as nta
import scipy
def gsr(epi_data, mask, direction="y", ref_file=None, out_file=None):
direction = direction.lower()
if direction[-1] not in ['x', 'y', 'all']:
raise Exception("Unknown direction %... | true | true |
790d9738efeb876e3e52c3f4c9907f9c3bb7fc43 | 18,305 | py | Python | app/src/main/python/KinoCode.py | susumOyaji/chaquopy-matplotlib-master | dda4a8da1391f968023bdd9d4b9c05e63b499390 | [
"MIT"
] | null | null | null | app/src/main/python/KinoCode.py | susumOyaji/chaquopy-matplotlib-master | dda4a8da1391f968023bdd9d4b9c05e63b499390 | [
"MIT"
] | null | null | null | app/src/main/python/KinoCode.py | susumOyaji/chaquopy-matplotlib-master | dda4a8da1391f968023bdd9d4b9c05e63b499390 | [
"MIT"
] | null | null | null | from sklearn.metrics import confusion_matrix, ConfusionMatrixDisplay
from sklearn.metrics import accuracy_score
from sklearn.model_selection import TimeSeriesSplit
from keras.layers import Dropout
from keras.layers import Dense, LSTM
from keras.models import Sequential
import numpy as np
from sklearn.preprocessing impo... | 26.414141 | 254 | 0.781043 | from sklearn.metrics import confusion_matrix, ConfusionMatrixDisplay
from sklearn.metrics import accuracy_score
from sklearn.model_selection import TimeSeriesSplit
from keras.layers import Dropout
from keras.layers import Dense, LSTM
from keras.models import Sequential
import numpy as np
from sklearn.preprocessing impo... | true | true |
790d97e566e99e7453937ad785d99d09ad9d43a7 | 220 | py | Python | src/tikkie2/v2/__init__.py | new10com/tikkie-api | 9dfa96f46eb5150fb22a9d65b7c90cd2133da442 | [
"MIT"
] | null | null | null | src/tikkie2/v2/__init__.py | new10com/tikkie-api | 9dfa96f46eb5150fb22a9d65b7c90cd2133da442 | [
"MIT"
] | null | null | null | src/tikkie2/v2/__init__.py | new10com/tikkie-api | 9dfa96f46eb5150fb22a9d65b7c90cd2133da442 | [
"MIT"
] | null | null | null | from . import ( # noqa
ideal_qr,
ideal_qr_notification,
payment,
payment_request,
payment_request_notification,
refund,
sandbox_app,
transaction_bundle,
transactions_notifications,
)
| 18.333333 | 33 | 0.7 | from . import (
ideal_qr,
ideal_qr_notification,
payment,
payment_request,
payment_request_notification,
refund,
sandbox_app,
transaction_bundle,
transactions_notifications,
)
| true | true |
790d985f21e29559ae25c3c407dbec1a5e270d4b | 4,351 | py | Python | iqs_client/models/twc_repository_info_response.py | thomas-bc/mms-autocref | 1db6697f929a1c782c902923209389e337ec6961 | [
"Apache-2.0"
] | null | null | null | iqs_client/models/twc_repository_info_response.py | thomas-bc/mms-autocref | 1db6697f929a1c782c902923209389e337ec6961 | [
"Apache-2.0"
] | null | null | null | iqs_client/models/twc_repository_info_response.py | thomas-bc/mms-autocref | 1db6697f929a1c782c902923209389e337ec6961 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
IncQuery Server
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: 0.12.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class TWCRep... | 30.858156 | 124 | 0.619168 |
import pprint
import re
import six
class TWCRepositoryInfoResponse(object):
openapi_types = {
'repository_structure': 'TWCRepositoryStructure',
'last_updated': 'str'
}
attribute_map = {
'repository_structure': 'repositoryStructure',
'last_updated': 'lastUpdated'
... | true | true |
790d98a72fe8f84a93bdacf95cb7a6a30c124775 | 3,462 | py | Python | toDoList/toDoList/settings.py | ruoyunruyan/toDoList | 99c06b67f3c153ae66871725b44cde907c972a86 | [
"MIT"
] | null | null | null | toDoList/toDoList/settings.py | ruoyunruyan/toDoList | 99c06b67f3c153ae66871725b44cde907c972a86 | [
"MIT"
] | null | null | null | toDoList/toDoList/settings.py | ruoyunruyan/toDoList | 99c06b67f3c153ae66871725b44cde907c972a86 | [
"MIT"
] | null | null | null | """
Django settings for toDoList project.
Generated by 'django-admin startproject' using Django 2.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
... | 27.046875 | 92 | 0.659445 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'r=cr&4z(#t-&vbyp_71-sy&edioe73mt48%)1ur^g1&@p$m69e'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'dja... | true | true |
790d99a94d22472b3df9e52c3412f8a2f82ec3ce | 3,270 | py | Python | trading_calendars/exchange_calendar_cmes.py | quantrocket-llc/trading-calendars | b72630cbcb288601c62e61ebe002a9043f9a3112 | [
"Apache-2.0"
] | 1 | 2020-07-25T06:18:30.000Z | 2020-07-25T06:18:30.000Z | trading_calendars/exchange_calendar_cmes.py | quantrocket-llc/trading-calendars | b72630cbcb288601c62e61ebe002a9043f9a3112 | [
"Apache-2.0"
] | 13 | 2021-04-13T06:49:23.000Z | 2022-03-31T00:08:10.000Z | trading_calendars/exchange_calendar_cmes.py | quantrocket-llc/trading-calendars | b72630cbcb288601c62e61ebe002a9043f9a3112 | [
"Apache-2.0"
] | 3 | 2020-03-05T23:38:14.000Z | 2021-12-12T00:31:36.000Z | #
# Copyright 2018 Quantopian, Inc.
#
# 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 wr... | 29.196429 | 144 | 0.624159 |
from datetime import time
from pandas.tseries.holiday import (
GoodFriday,
USLaborDay,
USPresidentsDay,
USThanksgivingDay,
)
from pytz import timezone
from .trading_calendar import HolidayCalendar, TradingCalendar
from .us_holidays import (
Christmas,
ChristmasEveBefore1993,
... | true | true |
790d9a42da8e6c811ed3b154e78306f6f7e56b9e | 144 | py | Python | AlteMatrix/ipanalyzer/__init__.py | Ir0n-c0d3X/AlteMatrix | 9479ddeec9839b88d8f7079d00fd62f3ee47157d | [
"MIT"
] | 10 | 2021-09-19T13:55:58.000Z | 2022-01-16T02:15:28.000Z | AlteMatrix/ipanalyzer/__init__.py | samuelajala01/AlteMatrix | e22fe443241fb646a218100bdcb19e0e4cc85635 | [
"MIT"
] | null | null | null | AlteMatrix/ipanalyzer/__init__.py | samuelajala01/AlteMatrix | e22fe443241fb646a218100bdcb19e0e4cc85635 | [
"MIT"
] | 2 | 2021-09-19T23:51:51.000Z | 2022-01-16T02:15:42.000Z | # Use of this source code is governed by the MIT license.
__license__ = "MIT"
"""This is the IP Analyzer program for the AlteMatrix module."""
| 28.8 | 64 | 0.736111 |
__license__ = "MIT"
| true | true |
790d9b66017834e0dfa129ac19fd3acb39af0d07 | 7,097 | py | Python | sb/stable_baselines_ex/common/wrappers_ex.py | artberryx/SAR | e6c79ea271f1033d5ea3c11556aff173adf6d941 | [
"MIT"
] | 4 | 2021-11-12T05:24:21.000Z | 2021-12-13T01:18:08.000Z | sb/stable_baselines_ex/common/wrappers_ex.py | artberryx/SAR | e6c79ea271f1033d5ea3c11556aff173adf6d941 | [
"MIT"
] | null | null | null | sb/stable_baselines_ex/common/wrappers_ex.py | artberryx/SAR | e6c79ea271f1033d5ea3c11556aff173adf6d941 | [
"MIT"
] | null | null | null | import gym
import numpy as np
from gym import spaces
from stable_baselines.common.running_mean_std import RunningMeanStd
class ScaleRewardEnv(gym.RewardWrapper):
def __init__(self, env: gym.Env, scale):
gym.RewardWrapper.__init__(self, env)
self.scale = scale
def reward(self, reward: float) ... | 35.133663 | 115 | 0.533888 | import gym
import numpy as np
from gym import spaces
from stable_baselines.common.running_mean_std import RunningMeanStd
class ScaleRewardEnv(gym.RewardWrapper):
def __init__(self, env: gym.Env, scale):
gym.RewardWrapper.__init__(self, env)
self.scale = scale
def reward(self, reward: float) ... | true | true |
790d9c116845947669e908b57d75437bbfcf16c8 | 4,041 | py | Python | conversions/length_conversion.py | NavpreetDevpuri/Python | 7ef5ae66d777e8ed702993c6aa9270e0669cb0c6 | [
"MIT"
] | 145,614 | 2016-07-21T05:40:05.000Z | 2022-03-31T22:17:22.000Z | conversions/length_conversion.py | NavpreetDevpuri/Python | 7ef5ae66d777e8ed702993c6aa9270e0669cb0c6 | [
"MIT"
] | 3,987 | 2016-07-28T17:31:25.000Z | 2022-03-30T23:07:46.000Z | conversions/length_conversion.py | NavpreetDevpuri/Python | 7ef5ae66d777e8ed702993c6aa9270e0669cb0c6 | [
"MIT"
] | 40,014 | 2016-07-26T15:14:41.000Z | 2022-03-31T22:23:03.000Z | """
Conversion of length units.
Available Units:- Metre,Kilometre,Feet,Inch,Centimeter,Yard,Foot,Mile,Millimeter
USAGE :
-> Import this file into their respective project.
-> Use the function length_conversion() for conversion of length units.
-> Parameters :
-> value : The number of from units you want to... | 32.853659 | 84 | 0.621133 |
from collections import namedtuple
from_to = namedtuple("from_to", "from_ to")
TYPE_CONVERSION = {
"millimeter": "mm",
"centimeter": "cm",
"meter": "m",
"kilometer": "km",
"inch": "in",
"inche": "in",
"feet": "ft",
"foot": "ft",
"yard": "yd",
"mile": "mi",
}
... | true | true |
790d9c7645afc33219e39cfaad728a2eff4993a3 | 3,474 | py | Python | kinetick/models/position.py | aWFtbGVnaW9u/kinetick | 2562a666ff57e72d1314e053db415d2873b8f71f | [
"Apache-2.0"
] | 1 | 2022-01-23T23:00:34.000Z | 2022-01-23T23:00:34.000Z | kinetick/models/position.py | aWFtbGVnaW9u/kinetick | 2562a666ff57e72d1314e053db415d2873b8f71f | [
"Apache-2.0"
] | null | null | null | kinetick/models/position.py | aWFtbGVnaW9u/kinetick | 2562a666ff57e72d1314e053db415d2873b8f71f | [
"Apache-2.0"
] | null | null | null | from mongoengine import StringField, DateTimeField, IntField, FloatField, BooleanField, DynamicDocument
from datetime import datetime
# note: position / order / trade are used interchangeably through the app.
class Position(DynamicDocument):
""" Position Data Model.
holds information relating to either trade/... | 31.297297 | 103 | 0.637018 | from mongoengine import StringField, DateTimeField, IntField, FloatField, BooleanField, DynamicDocument
from datetime import datetime
class Position(DynamicDocument):
_tickerId = StringField(max_length=50, required=True, db_field="tickerId")
_symbol = StringField(max_length=50, required=False, db_field="symb... | true | true |
790d9e6dfa929eb30227ee925a46f34c1ce1594a | 1,642 | py | Python | RK45 - Copy.py | Mahdi-Asadi/python_thesis | 6cb1dbe24fcf9133e971e64c91e1dde234250da9 | [
"MIT"
] | null | null | null | RK45 - Copy.py | Mahdi-Asadi/python_thesis | 6cb1dbe24fcf9133e971e64c91e1dde234250da9 | [
"MIT"
] | null | null | null | RK45 - Copy.py | Mahdi-Asadi/python_thesis | 6cb1dbe24fcf9133e971e64c91e1dde234250da9 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import RK45
f_out = "E:\\1\\P_rk4.txt" # address file for output
f2 = open(f_out,"w+")
def du_dx(x,y):
wa=1 # atomic frequency
wp=0.6 # field frequency
g=0.6 # coupling strength
n = 1 # number of photons
A = n*... | 23.457143 | 76 | 0.476248 | import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import RK45
f_out = "E:\\1\\P_rk4.txt"
f2 = open(f_out,"w+")
def du_dx(x,y):
wa=1
wp=0.6
g=0.6
n = 1
A = n*wp+(wa/2)
B = (1+n)*wp-(wa/2)
X = n+1
C = np.sqrt(X)
dydx_1= A*y[1]+g*C*y[3]
... | true | true |
790d9e8d01cd1e437033f450863d4865f44cd735 | 22,915 | py | Python | metaflow/datatools/s3.py | oliverholworthy/metaflow | 378e718a0091d1189e92f3027e3a52c659be59bc | [
"Apache-2.0"
] | 2 | 2020-06-07T13:52:03.000Z | 2020-08-17T17:05:06.000Z | metaflow/datatools/s3.py | oliverholworthy/metaflow | 378e718a0091d1189e92f3027e3a52c659be59bc | [
"Apache-2.0"
] | null | null | null | metaflow/datatools/s3.py | oliverholworthy/metaflow | 378e718a0091d1189e92f3027e3a52c659be59bc | [
"Apache-2.0"
] | 1 | 2020-03-12T11:12:38.000Z | 2020-03-12T11:12:38.000Z | import os
import sys
import time
import shutil
import random
import subprocess
from itertools import starmap
from tempfile import mkdtemp, NamedTemporaryFile
from .. import current, FlowSpec
from ..metaflow_config import DATATOOLS_S3ROOT
from ..util import is_stringish,\
to_bytes,\
... | 35.472136 | 86 | 0.514728 | import os
import sys
import time
import shutil
import random
import subprocess
from itertools import starmap
from tempfile import mkdtemp, NamedTemporaryFile
from .. import current, FlowSpec
from ..metaflow_config import DATATOOLS_S3ROOT
from ..util import is_stringish,\
to_bytes,\
... | true | true |
790da00e416e6ea53931fd81ed764a45913d098e | 1,674 | py | Python | week4/week4_additionalexercice_5.py | harshonyou/SOFT1 | 1bd2b0cc26d39c549bec576389bebd0fd011387d | [
"Apache-2.0"
] | null | null | null | week4/week4_additionalexercice_5.py | harshonyou/SOFT1 | 1bd2b0cc26d39c549bec576389bebd0fd011387d | [
"Apache-2.0"
] | null | null | null | week4/week4_additionalexercice_5.py | harshonyou/SOFT1 | 1bd2b0cc26d39c549bec576389bebd0fd011387d | [
"Apache-2.0"
] | null | null | null | '''
Exercise 5: Vectors
A vector of dimension 𝑛𝑛 can be represented by a list in Python. For example, a vector of
dimension 3 could represent a point in space, and a vector of dimension 4 could represent a
point in space and time (the fourth dimension being the time). In mathematical notation, a
vector of dimension 3... | 27.442623 | 124 | 0.717443 | def scalar_product(scalar, vector):
for x in range(len(vector)):
vector[x]*=scalar
return vector
def vector_addition(vector1, vector2):
if(len(vector2)!=len(vector1)):
return 'Error'
for x in range(len(vector1)):
vector1[x]=int(vector1[x])+int(vector2[x])
return vector1
pr... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.