hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
790c9a37b43ab557243b6ae70830c18c9d0ac3c0 | 1,093 | py | Python | bin/test_server.py | jonelleamio/AdventureGameServer | be55e48508be4df83fa5e44c77aae26ee072d8e8 | [
"MIT"
] | null | null | null | bin/test_server.py | jonelleamio/AdventureGameServer | be55e48508be4df83fa5e44c77aae26ee072d8e8 | [
"MIT"
] | null | null | null | bin/test_server.py | jonelleamio/AdventureGameServer | be55e48508be4df83fa5e44c77aae26ee072d8e8 | [
"MIT"
] | null | null | null | import requests
import json
from pprint import pprint as print
def getCode(res:str) :
return str(res).split("[")[1].split("]")[0]
url = 'http://localhost:4042'
guid = '2012491924' # get guid from connexion.json()
guid2 = '0'
gurl = f"{url}/{guid}"
home = requests.post(url)
print (getCode(home))
print (home.json(... | 25.418605 | 65 | 0.601098 | import requests
import json
from pprint import pprint as print
def getCode(res:str) :
return str(res).split("[")[1].split("]")[0]
url = 'http://localhost:4042'
guid = '2012491924'
guid2 = '0'
gurl = f"{url}/{guid}"
home = requests.post(url)
print (getCode(home))
print (home.json())
print ("\n\n#################... | true | true |
790c9babee7534ddf4ada2ee36f6194753c0e399 | 769 | py | Python | setup.py | listingmirror/async-gelf-handler | 5b2e665e229277f914db0247ac174f7090882eb7 | [
"BSD-3-Clause"
] | null | null | null | setup.py | listingmirror/async-gelf-handler | 5b2e665e229277f914db0247ac174f7090882eb7 | [
"BSD-3-Clause"
] | null | null | null | setup.py | listingmirror/async-gelf-handler | 5b2e665e229277f914db0247ac174f7090882eb7 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='async-gelf-handler',
version='0.1.4',
description="An async wrapper around the GELF (Graylog Extended Log Format).",
long_description=open('README.rst').read(),
keywords='logging gelf graylog2 graylog async',
author... | 34.954545 | 82 | 0.6671 |
from setuptools import setup, find_packages
setup(
name='async-gelf-handler',
version='0.1.4',
description="An async wrapper around the GELF (Graylog Extended Log Format).",
long_description=open('README.rst').read(),
keywords='logging gelf graylog2 graylog async',
author='Developer',
aut... | true | true |
790c9d5690afc8b243bed367fe71b0de57bb58d3 | 2,137 | py | Python | ambulation/envs/poppy_humanoid_keep_standing/poppy_humanoid_keep_standing.py | garrettkatz/poppy-simulations | cd4d132ab6f8b4e69f2edd89662980d252a27966 | [
"MIT"
] | null | null | null | ambulation/envs/poppy_humanoid_keep_standing/poppy_humanoid_keep_standing.py | garrettkatz/poppy-simulations | cd4d132ab6f8b4e69f2edd89662980d252a27966 | [
"MIT"
] | null | null | null | ambulation/envs/poppy_humanoid_keep_standing/poppy_humanoid_keep_standing.py | garrettkatz/poppy-simulations | cd4d132ab6f8b4e69f2edd89662980d252a27966 | [
"MIT"
] | null | null | null | import numpy as np
from gym.envs.mujoco import mujoco_env
from gym import utils
def mass_center(model, sim):
mass = np.expand_dims(model.body_mass, 1)
xpos = sim.data.xipos
return (np.sum(mass * xpos, 0) / np.sum(mass))[0]
class PoppyHumanoidKeepStandingEnv(mujoco_env.MujocoEnv, utils.EzPickle):
def _... | 41.096154 | 170 | 0.614881 | import numpy as np
from gym.envs.mujoco import mujoco_env
from gym import utils
def mass_center(model, sim):
mass = np.expand_dims(model.body_mass, 1)
xpos = sim.data.xipos
return (np.sum(mass * xpos, 0) / np.sum(mass))[0]
class PoppyHumanoidKeepStandingEnv(mujoco_env.MujocoEnv, utils.EzPickle):
def _... | true | true |
790c9d5cec04c1860dd1ed714064d05f2545570c | 4,090 | py | Python | pinax/blog/forms.py | Zorking/pinax-blog | 5546888894557b69c5e7a0b846ea8d8213aba6f2 | [
"MIT"
] | null | null | null | pinax/blog/forms.py | Zorking/pinax-blog | 5546888894557b69c5e7a0b846ea8d8213aba6f2 | [
"MIT"
] | null | null | null | pinax/blog/forms.py | Zorking/pinax-blog | 5546888894557b69c5e7a0b846ea8d8213aba6f2 | [
"MIT"
] | null | null | null | from functools import partial as curry
from django import forms
from django.utils import timezone
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
from pinax.images.models import ImageSet
from mdeditor.fields import MDTextFormField
from .conf import settings
from .models... | 26.558442 | 86 | 0.593643 | from functools import partial as curry
from django import forms
from django.utils import timezone
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
from pinax.images.models import ImageSet
from mdeditor.fields import MDTextFormField
from .conf import settings
from .models... | true | true |
790c9d790013fdd415cbbabb3e28ad10ea87596d | 510 | py | Python | moviepy/video/fx/supersample.py | va6996/moviepy | 60b95c37816413da6bf304e85f8c0ba8e2d2c6e7 | [
"MIT"
] | null | null | null | moviepy/video/fx/supersample.py | va6996/moviepy | 60b95c37816413da6bf304e85f8c0ba8e2d2c6e7 | [
"MIT"
] | null | null | null | moviepy/video/fx/supersample.py | va6996/moviepy | 60b95c37816413da6bf304e85f8c0ba8e2d2c6e7 | [
"MIT"
] | null | null | null | import cupy as np
def supersample(clip, d, n_frames):
"""Replaces each frame at time t by the mean of `n_frames` equally spaced frames
taken in the interval [t-d, t+d]. This results in motion blur.
"""
def filter(get_frame, t):
timings = np.linspace(t - d, t + d, n_frames)
frame_avera... | 30 | 85 | 0.627451 | import cupy as np
def supersample(clip, d, n_frames):
def filter(get_frame, t):
timings = np.linspace(t - d, t + d, n_frames)
frame_average = np.mean(
1.0 * np.array([get_frame(t_) for t_ in timings], dtype="uint16"), axis=0
)
return frame_average.astype("uint8")
... | true | true |
790c9dea203af1c08329112908e3c2f9c93e3603 | 7,165 | py | Python | synthetic/blobs/train.py | pattonw/mouselight | 296e6df7d4e79776ed9f8533d17d937bb6866082 | [
"MIT"
] | null | null | null | synthetic/blobs/train.py | pattonw/mouselight | 296e6df7d4e79776ed9f8533d17d937bb6866082 | [
"MIT"
] | null | null | null | synthetic/blobs/train.py | pattonw/mouselight | 296e6df7d4e79776ed9f8533d17d937bb6866082 | [
"MIT"
] | null | null | null | from mahotas import cwatershed
from mala.losses import ultrametric_loss_op
from scipy.ndimage.filters import gaussian_filter
from scipy.ndimage.filters import maximum_filter
from scipy.ndimage.morphology import distance_transform_edt
import gunpowder as gp
import json
import numpy as np
import skelerator
import tensorf... | 29.364754 | 85 | 0.573203 | from mahotas import cwatershed
from mala.losses import ultrametric_loss_op
from scipy.ndimage.filters import gaussian_filter
from scipy.ndimage.filters import maximum_filter
from scipy.ndimage.morphology import distance_transform_edt
import gunpowder as gp
import json
import numpy as np
import skelerator
import tensorf... | true | true |
790c9e9cf79b76caba1c7ce4f75ffc0fbf3e7109 | 1,341 | py | Python | Store/robot-test-old/hand_shake.py | Quanta-Robotics/Robot-Blueberry | 7b7e77e09ac5e9ec5afd947e0db1ecc8773e56da | [
"MIT"
] | 25 | 2021-06-08T07:09:30.000Z | 2021-12-30T06:28:35.000Z | Store/robot-test-old/hand_shake.py | ICT-CoU/Robot-Blueberry | d19fd1be037df9d67de64df57a87006d74cd6c43 | [
"MIT"
] | 2 | 2021-05-23T12:54:51.000Z | 2021-06-07T17:47:56.000Z | Store/robot-test-old/hand_shake.py | ICT-CoU/Robot-Blueberry | d19fd1be037df9d67de64df57a87006d74cd6c43 | [
"MIT"
] | 14 | 2021-06-08T13:02:28.000Z | 2021-12-30T20:07:18.000Z | import time
import RPi.GPIO as GPIO
from adafruit_servokit import ServoKit
'''GPIO.setmode(GPIO.BCM)
GPIO.setup(11,GPIO.OUT)
servo1=GPIO.PWM(11,50)
servo1.start(2)'''
h = ServoKit(channels=16)
#servo1.ChangeDutyCycle(12)
#kit.servo[0].angle
init = [0,90,20,0,180,160,170,180,60,0,0,150]
limitLo = [0,0,20,0,0,40,0,... | 20.630769 | 64 | 0.595078 | import time
import RPi.GPIO as GPIO
from adafruit_servokit import ServoKit
h = ServoKit(channels=16)
init = [0,90,20,0,180,160,170,180,60,0,0,150]
limitLo = [0,0,20,0,0,40,0,0,60,0,0,30]
limitHi = [35,180,180,180,180,160,170,180,180,180,180,150]
cur = init
def changeDeg(pin,newDegree):
maxChange = 0
p... | true | true |
790c9ea157ca7b565c4ae13301ba9d54c2dac2ff | 351 | py | Python | taxon/config.py | linsalrob/EdwardsLab | 3d4eef1dda61c31ce8163d94d86f186275a6e4a4 | [
"MIT"
] | 30 | 2015-01-25T16:22:51.000Z | 2022-01-20T15:56:47.000Z | taxon/config.py | linsalrob/EdwardsLab | 3d4eef1dda61c31ce8163d94d86f186275a6e4a4 | [
"MIT"
] | 2 | 2020-04-13T15:00:37.000Z | 2020-09-23T12:35:59.000Z | taxon/config.py | linsalrob/EdwardsLab | 3d4eef1dda61c31ce8163d94d86f186275a6e4a4 | [
"MIT"
] | 24 | 2015-04-17T00:52:05.000Z | 2021-11-26T17:50:01.000Z | """
Some settings for the config files
"""
# defaultdir = '/data/ncbi/taxonomy/current'
# defaultdir = '/home/edwa0468/ncbi/taxonomy'
defaultdir = '/raid60/usr/data/NCBI/taxonomy/current/'
def get_db_dir():
"""
Just return the default dir listed above
:return: the default location for the sqllite database... | 23.4 | 58 | 0.700855 |
defaultdir = '/raid60/usr/data/NCBI/taxonomy/current/'
def get_db_dir():
return defaultdir
| true | true |
790c9fcf219c42b2d8e0648aa613b2e4e1b83ccf | 484 | py | Python | ex30.py | AyeThandarAung/python-exercises | a4ac378052cddd197deaa2522486572dd6c44678 | [
"MIT"
] | null | null | null | ex30.py | AyeThandarAung/python-exercises | a4ac378052cddd197deaa2522486572dd6c44678 | [
"MIT"
] | null | null | null | ex30.py | AyeThandarAung/python-exercises | a4ac378052cddd197deaa2522486572dd6c44678 | [
"MIT"
] | null | null | null | people = 30
cars = 40
trucks = 15
if cars > people:
print("We should take the cars.")
elif cars < people:
print("We should not take the cars.")
else:
print("We can't decide.")
if trucks > cars:
print("That's too many trucks.")
elif trucks < cars:
print("Maybe we could take the trucks.")
... | 24.2 | 50 | 0.621901 | people = 30
cars = 40
trucks = 15
if cars > people:
print("We should take the cars.")
elif cars < people:
print("We should not take the cars.")
else:
print("We can't decide.")
if trucks > cars:
print("That's too many trucks.")
elif trucks < cars:
print("Maybe we could take the trucks.")
... | true | true |
790ca0da0398153af629e260f133702a1559ea52 | 6,589 | py | Python | packages/fetchai/skills/generic_seller/behaviours.py | ejfitzgerald/agents-aea | 6411fcba8af2cdf55a3005939ae8129df92e8c3e | [
"Apache-2.0"
] | null | null | null | packages/fetchai/skills/generic_seller/behaviours.py | ejfitzgerald/agents-aea | 6411fcba8af2cdf55a3005939ae8129df92e8c3e | [
"Apache-2.0"
] | null | null | null | packages/fetchai/skills/generic_seller/behaviours.py | ejfitzgerald/agents-aea | 6411fcba8af2cdf55a3005939ae8129df92e8c3e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... | 38.086705 | 96 | 0.670815 |
from typing import cast
from aea.skills.behaviours import TickerBehaviour
from packages.fetchai.protocols.ledger_api.message import LedgerApiMessage
from packages.fetchai.protocols.oef_search.message import OefSearchMessage
from packages.fetchai.skills.generic_seller.dialogues import (
LedgerA... | true | true |
790ca14900667962fd2acd2fca8ca22d5c0151f4 | 6,258 | py | Python | Camera/camera.py | marioliu/AutonomousQuadblade | 08fe54fe37df89ffc7e6378125bb14ad5bead421 | [
"MIT"
] | null | null | null | Camera/camera.py | marioliu/AutonomousQuadblade | 08fe54fe37df89ffc7e6378125bb14ad5bead421 | [
"MIT"
] | null | null | null | Camera/camera.py | marioliu/AutonomousQuadblade | 08fe54fe37df89ffc7e6378125bb14ad5bead421 | [
"MIT"
] | null | null | null | '''
Adapted from https://github.com/IntelligentQuadruped, with permission
Description: Module to connect to camera and retrieve RGB and depth data. Currently supports the Intel RealSense R200 Camera.
'''
import numpy as np
import logging
import time
import cv2
import matplotlib.pyplot as plt
from skimage.transform imp... | 31.134328 | 125 | 0.591243 |
import numpy as np
import logging
import time
import cv2
import matplotlib.pyplot as plt
from skimage.transform import rescale
from file_support import ensureDir
from os import path, makedirs
try:
import pyrealsense as pyrs
except ImportError as error:
logging.warning("cam.py: " + str(error))
class Camera:
... | true | true |
790ca2977ba11710d82c4fbdfee227696a4c639e | 6,020 | py | Python | src/models/resnet50.py | motokimura/cowc_car_counting | 833795e1b5cc6831409e86bd4b9fe2199c9cb287 | [
"MIT"
] | 46 | 2018-11-05T15:21:51.000Z | 2022-02-01T16:08:38.000Z | src/models/resnet50.py | motokimura/cowc_car_counting | 833795e1b5cc6831409e86bd4b9fe2199c9cb287 | [
"MIT"
] | 2 | 2019-12-12T02:56:24.000Z | 2020-11-30T20:14:56.000Z | src/models/resnet50.py | motokimura/cowc_car_counting | 833795e1b5cc6831409e86bd4b9fe2199c9cb287 | [
"MIT"
] | 9 | 2018-12-21T02:58:43.000Z | 2021-09-02T12:00:47.000Z | # Original author: yasunorikudo
# (https://github.com/yasunorikudo/chainer-ResNet)
import chainer
import chainer.functions as F
from chainer import initializers
import chainer.links as L
class BottleNeckA(chainer.Chain):
def __init__(self, in_size, ch, out_size, stride=2):
super(BottleNeckA, self).__init__()
i... | 31.684211 | 97 | 0.697674 |
import chainer
import chainer.functions as F
from chainer import initializers
import chainer.links as L
class BottleNeckA(chainer.Chain):
def __init__(self, in_size, ch, out_size, stride=2):
super(BottleNeckA, self).__init__()
initialW = initializers.HeNormal()
with self.init_scope():
self.conv1 = L.Co... | true | true |
790ca2987e8b94a36faaf0e7acfbfa1c189a6101 | 5,924 | py | Python | utils/parsxv2/typesystem.py | dstep/old_jf_compiler | 3e179d91584308d9e7a69e76a78542e83ec2d50b | [
"MIT"
] | null | null | null | utils/parsxv2/typesystem.py | dstep/old_jf_compiler | 3e179d91584308d9e7a69e76a78542e83ec2d50b | [
"MIT"
] | null | null | null | utils/parsxv2/typesystem.py | dstep/old_jf_compiler | 3e179d91584308d9e7a69e76a78542e83ec2d50b | [
"MIT"
] | null | null | null | class Type:
def __init__(self):
pass
def get_repr(self):
return self
def __repr__(self):
return self.get_repr().stringify()
def stringify(self):
return ""
def put_on_stack(self, stack):
stack.put(self.get_repr())
def take_from_stack(self, stack):
... | 29.182266 | 148 | 0.58339 | class Type:
def __init__(self):
pass
def get_repr(self):
return self
def __repr__(self):
return self.get_repr().stringify()
def stringify(self):
return ""
def put_on_stack(self, stack):
stack.put(self.get_repr())
def take_from_stack(self, stack):
... | true | true |
790ca313c418489814b3f9e22b482dc1e87557ee | 2,705 | py | Python | Super_Pow.py | thydeyx/LeetCode-Python | 03296dfa37910ef13b0726bde5e757b52f1590d7 | [
"MIT"
] | 1 | 2017-05-21T04:28:37.000Z | 2017-05-21T04:28:37.000Z | Super_Pow.py | thydeyx/LeetCode-Python | 03296dfa37910ef13b0726bde5e757b52f1590d7 | [
"MIT"
] | null | null | null | Super_Pow.py | thydeyx/LeetCode-Python | 03296dfa37910ef13b0726bde5e757b52f1590d7 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
#
# Author : TangHanYi
# E-mail : thydeyx@163.com
# Create Date : 2016-12-11 09:33:17 AM
# Last modified : 2016-12-11 10:48:50 AM
# File Name : Super_Pow.py
# Desc :
class Solution(object):
def superPow(self, a, b):
if len(b) == 0:
return a
tmp = a
ret = 1... | 69.358974 | 2,008 | 0.497597 |
class Solution(object):
def superPow(self, a, b):
if len(b) == 0:
return a
tmp = a
ret = 1
n = len(b)
k = 0
while k != n - 1:
if b[-1] % 2 == 1:
ret = (ret * tmp) % 1337
tmp = (tmp * tmp) % 1337
pre = 0
for i in range(k, n):
pre_b = (pre * 10 + b[i]) % 2
b[i] = (pre * 1... | false | true |
790ca36ebd16ce8f24e568c044f47b77b90fdfbb | 30 | py | Python | src/products/__init__.py | GG31/openfood-graphql-api | 7b6f74706502f79126c47beb3d47cd07146c8679 | [
"MIT"
] | null | null | null | src/products/__init__.py | GG31/openfood-graphql-api | 7b6f74706502f79126c47beb3d47cd07146c8679 | [
"MIT"
] | 1 | 2018-12-25T22:45:13.000Z | 2018-12-25T22:45:13.000Z | src/products/__init__.py | GG31/openfood-graphql-api | 7b6f74706502f79126c47beb3d47cd07146c8679 | [
"MIT"
] | null | null | null | from .products import Products | 30 | 30 | 0.866667 | from .products import Products | true | true |
790ca51d9f535dae8f1860efbd39a6910a1fd6b2 | 1,897 | py | Python | main.py | cheran-senthil/SultanKhan2 | c2f84080cd79ce3897f7fac82455a4da0d7d7c28 | [
"MIT"
] | 2 | 2020-12-10T18:32:51.000Z | 2021-05-29T04:25:25.000Z | main.py | Cheran-Senthil/SultanKhan2 | c2f84080cd79ce3897f7fac82455a4da0d7d7c28 | [
"MIT"
] | null | null | null | main.py | Cheran-Senthil/SultanKhan2 | c2f84080cd79ce3897f7fac82455a4da0d7d7c28 | [
"MIT"
] | 1 | 2021-03-31T05:03:03.000Z | 2021-03-31T05:03:03.000Z | import berserk
import chaturanga
token = 'token'
bot_id = 'sultankhan2'
session = berserk.TokenSession(token)
lichess = berserk.Client(session)
for event in lichess.bots.stream_incoming_events():
if event['type'] == 'challenge':
challenge = event['challenge']
if challenge['variant']['key'] == 'st... | 36.480769 | 70 | 0.508698 | import berserk
import chaturanga
token = 'token'
bot_id = 'sultankhan2'
session = berserk.TokenSession(token)
lichess = berserk.Client(session)
for event in lichess.bots.stream_incoming_events():
if event['type'] == 'challenge':
challenge = event['challenge']
if challenge['variant']['key'] == 'st... | true | true |
790ca526824369fdd3f703c070674bae414a0614 | 1,502 | py | Python | aliyun-python-sdk-cs/aliyunsdkcs/request/v20151215/PauseClusterUpgradeRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-cs/aliyunsdkcs/request/v20151215/PauseClusterUpgradeRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-cs/aliyunsdkcs/request/v20151215/PauseClusterUpgradeRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38.512821 | 74 | 0.768309 |
from aliyunsdkcore.request import RoaRequest
from aliyunsdkcs.endpoint import endpoint_data
class PauseClusterUpgradeRequest(RoaRequest):
def __init__(self):
RoaRequest.__init__(self, 'CS', '2015-12-15', 'PauseClusterUpgrade')
self.set_uri_pattern('/api/v2/clusters/[ClusterId]/upgrade/pause')... | true | true |
790ca5ba75d3b01cb5868c7361555b131ec0a8b0 | 5,916 | py | Python | venv/lib/python3.5/site-packages/coalib/misc/Shell.py | prashant0598/CoffeeApp | 4fa006aebf06e12ed34766450ddcfa548ee63307 | [
"MIT"
] | null | null | null | venv/lib/python3.5/site-packages/coalib/misc/Shell.py | prashant0598/CoffeeApp | 4fa006aebf06e12ed34766450ddcfa548ee63307 | [
"MIT"
] | null | null | null | venv/lib/python3.5/site-packages/coalib/misc/Shell.py | prashant0598/CoffeeApp | 4fa006aebf06e12ed34766450ddcfa548ee63307 | [
"MIT"
] | null | null | null | from contextlib import contextmanager
import platform
import shlex
from subprocess import PIPE, Popen
from shutil import which
class ShellCommandResult(tuple):
"""
The result of a :func:`coalib.misc.run_shell_command` call.
It is based on a ``(stdout, stderr)`` string tuple like it is returned
form `... | 35.42515 | 79 | 0.615619 | from contextlib import contextmanager
import platform
import shlex
from subprocess import PIPE, Popen
from shutil import which
class ShellCommandResult(tuple):
def __new__(cls, code, stdout, stderr):
return tuple.__new__(cls, (stdout, stderr))
def __init__(self, code, stdout, stderr):
self.c... | true | true |
790ca83823d22be1ff3f0729ae69724cb8efce03 | 1,985 | py | Python | services/director-v2/tests/unit/test_core_settings.py | ITISFoundation/osparc-simcore | 5ef4cd985f98f1ca4ee116659624748c5bf683a8 | [
"MIT"
] | 25 | 2018-04-13T12:44:12.000Z | 2022-03-12T15:01:17.000Z | services/director-v2/tests/unit/test_core_settings.py | ITISFoundation/osparc-simcore | 5ef4cd985f98f1ca4ee116659624748c5bf683a8 | [
"MIT"
] | 2,553 | 2018-01-18T17:11:55.000Z | 2022-03-31T16:26:40.000Z | services/director-v2/tests/unit/test_core_settings.py | ITISFoundation/osparc-simcore | 5ef4cd985f98f1ca4ee116659624748c5bf683a8 | [
"MIT"
] | 20 | 2018-01-18T19:45:33.000Z | 2022-03-29T07:08:47.000Z | # pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
import pytest
from models_library.basic_types import LogLevel
from simcore_service_director_v2.core.settings import (
AppSettings,
BootModeEnum,
DynamicSidecarProxySettings,
DynamicSidecarSettings,
... | 31.015625 | 80 | 0.70529 |
import pytest
from models_library.basic_types import LogLevel
from simcore_service_director_v2.core.settings import (
AppSettings,
BootModeEnum,
DynamicSidecarProxySettings,
DynamicSidecarSettings,
RegistrySettings,
)
def test_settings_with_project_env_devel(project_env_devel_environment):
... | true | true |
790ca8e976d69dae30f216759e78084e78f20a8e | 2,964 | py | Python | submodules/GAN_stability/gan_training/checkpoints.py | joebartusek/graf | 80e1014a1def2660a44188c69021f0c498b6cef9 | [
"MIT"
] | 888 | 2018-07-02T17:42:36.000Z | 2022-03-29T16:38:14.000Z | submodules/GAN_stability/gan_training/checkpoints.py | joebartusek/graf | 80e1014a1def2660a44188c69021f0c498b6cef9 | [
"MIT"
] | 20 | 2018-08-14T22:55:18.000Z | 2020-12-29T05:13:54.000Z | submodules/GAN_stability/gan_training/checkpoints.py | joebartusek/graf | 80e1014a1def2660a44188c69021f0c498b6cef9 | [
"MIT"
] | 134 | 2018-07-07T17:16:57.000Z | 2022-03-11T14:32:28.000Z |
import os
import urllib
import torch
from torch.utils import model_zoo
class CheckpointIO(object):
''' CheckpointIO class.
It handles saving and loading checkpoints.
Args:
checkpoint_dir (str): path where checkpoints are saved
'''
def __init__(self, checkpoint_dir='./chkpts', **kwargs):... | 29.346535 | 70 | 0.584345 |
import os
import urllib
import torch
from torch.utils import model_zoo
class CheckpointIO(object):
def __init__(self, checkpoint_dir='./chkpts', **kwargs):
self.module_dict = kwargs
self.checkpoint_dir = checkpoint_dir
if not os.path.exists(checkpoint_dir):
os.makedirs(checkpo... | true | true |
790ca91d1e267c27a75b0c472c8aadefd871871f | 11,385 | py | Python | main.py | VV123/NLIDB_gradient | f42a6f383d2d4ac41c354cf55df2a21507577b02 | [
"MIT"
] | null | null | null | main.py | VV123/NLIDB_gradient | f42a6f383d2d4ac41c354cf55df2a21507577b02 | [
"MIT"
] | 1 | 2021-01-11T03:42:43.000Z | 2021-02-19T17:06:59.000Z | main.py | VV123/NLIDB_gradient | f42a6f383d2d4ac41c354cf55df2a21507577b02 | [
"MIT"
] | null | null | null | # coding=utf-8
import sys
import argparse
import os
from tensorflow.python.platform import gfile
import numpy as np
import tensorflow as tf
from tensorflow.python.layers.core import Dense
from utils.data_manager import load_data, load_data_one
from collections import defaultdict
from argparse import ArgumentParser
fro... | 33.683432 | 133 | 0.623188 |
import sys
import argparse
import os
from tensorflow.python.platform import gfile
import numpy as np
import tensorflow as tf
from tensorflow.python.layers.core import Dense
from utils.data_manager import load_data, load_data_one
from collections import defaultdict
from argparse import ArgumentParser
from decode_helpe... | true | true |
790caa0bf021f34fdce2d7643a1774a9d95627ce | 2,397 | py | Python | smoketests/tests/dashboard/test_product_filter.py | DESHRAJ/fjord | 8899b6286b23347c9b024334e61c33fe133e836d | [
"BSD-3-Clause"
] | null | null | null | smoketests/tests/dashboard/test_product_filter.py | DESHRAJ/fjord | 8899b6286b23347c9b024334e61c33fe133e836d | [
"BSD-3-Clause"
] | null | null | null | smoketests/tests/dashboard/test_product_filter.py | DESHRAJ/fjord | 8899b6286b23347c9b024334e61c33fe133e836d | [
"BSD-3-Clause"
] | null | null | null | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import pytest
from unittestzero import Assert
from pages.dashboard import DashboardPage
class TestProductFilter(objec... | 39.295082 | 83 | 0.673759 |
import pytest
from unittestzero import Assert
from pages.dashboard import DashboardPage
class TestProductFilter(object):
@pytest.mark.nondestructive
def test_feedback_can_be_filtered_by_all_products_and_versions(self, mozwebqa):
dashboard_pg = DashboardPage(mozwebqa)
dashboard_pg.go_to_d... | true | true |
790caab67268b9a7464cda38497d7cfb5ee81bd6 | 806 | py | Python | template/analytics.py | JasonKeirstead/kestrel-analytics | 4b8ab9b43ff3f73616e5a1a902f8c46bb00b83c0 | [
"Apache-2.0"
] | 1 | 2021-05-28T02:56:15.000Z | 2021-05-28T02:56:15.000Z | template/analytics.py | JasonKeirstead/kestrel-analytics | 4b8ab9b43ff3f73616e5a1a902f8c46bb00b83c0 | [
"Apache-2.0"
] | null | null | null | template/analytics.py | JasonKeirstead/kestrel-analytics | 4b8ab9b43ff3f73616e5a1a902f8c46bb00b83c0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import pandas as pd
# Kestrel analytics default paths (single input variable)
INPUT_DATA_PATH = "/data/input/0.parquet.gz"
OUTPUT_DATA_PATH = "/data/output/0.parquet.gz"
OUTPUT_DISPLAY = "/data/display/ret.html"
def analytics(dataframe):
# analyze data in dataframe
# provide insights ... | 28.785714 | 68 | 0.703474 |
import pandas as pd
INPUT_DATA_PATH = "/data/input/0.parquet.gz"
OUTPUT_DATA_PATH = "/data/output/0.parquet.gz"
OUTPUT_DISPLAY = "/data/display/ret.html"
def analytics(dataframe):
newattr = ["newval" + str(i) for i in range(dataframe.shape[0])]
dataframe["x_new_attr"] = newattr
display = "<... | true | true |
790caadb9885b423dd3032914819724eb9e60be4 | 5,922 | py | Python | tests/gold_tests/pluginTest/cert_update/cert_update.test.py | zds05/trafficserver | 258c69b7628f5a4b90488e147c244a582222b5c8 | [
"Apache-2.0"
] | null | null | null | tests/gold_tests/pluginTest/cert_update/cert_update.test.py | zds05/trafficserver | 258c69b7628f5a4b90488e147c244a582222b5c8 | [
"Apache-2.0"
] | null | null | null | tests/gold_tests/pluginTest/cert_update/cert_update.test.py | zds05/trafficserver | 258c69b7628f5a4b90488e147c244a582222b5c8 | [
"Apache-2.0"
] | null | null | null | '''
Test the cert_update plugin.
'''
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Ve... | 41.412587 | 166 | 0.738433 |
import os
import ports
Test.Summary = '''
Test cert_update plugin.
'''
Test.SkipUnless(
Condition.HasProgram("openssl", "Openssl need to be installed on system for this test to work")
)
server = Test.MakeOriginServer("server")
request_header = {
"headers": "GET / HTTP/1.1\r\nHost: doesnotmat... | true | true |
790cabdaf6f9ce0aff9ebb0c0baf32a2adc64dca | 10,544 | py | Python | tensorflow/python/ops/ragged/ragged_dynamic_partition_op_test.py | abhaikollara/tensorflow | 4f96df3659696990cb34d0ad07dc67843c4225a9 | [
"Apache-2.0"
] | 848 | 2019-12-03T00:16:17.000Z | 2022-03-31T22:53:17.000Z | tensorflow/python/ops/ragged/ragged_dynamic_partition_op_test.py | abhaikollara/tensorflow | 4f96df3659696990cb34d0ad07dc67843c4225a9 | [
"Apache-2.0"
] | 656 | 2019-12-03T00:48:46.000Z | 2022-03-31T18:41:54.000Z | tensorflow/python/ops/ragged/ragged_dynamic_partition_op_test.py | abhaikollara/tensorflow | 4f96df3659696990cb34d0ad07dc67843c4225a9 | [
"Apache-2.0"
] | 506 | 2019-12-03T00:46:26.000Z | 2022-03-30T10:34:56.000Z | # Copyright 2019 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... | 40.868217 | 80 | 0.519537 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
from tensorflow.python.eager import context
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import errors
from tensorflow.p... | true | true |
790cabf97033d15b56e34c6ad85ac3cc081dc2d1 | 4,054 | py | Python | codelabs/spark-bigquery/backfill.py | aosterloh/cloud-dataproc | ceca098d6e77e6d2b5147ff79bc69be9a035c296 | [
"Apache-2.0"
] | null | null | null | codelabs/spark-bigquery/backfill.py | aosterloh/cloud-dataproc | ceca098d6e77e6d2b5147ff79bc69be9a035c296 | [
"Apache-2.0"
] | 9 | 2019-12-16T22:20:20.000Z | 2022-02-10T01:24:30.000Z | spark-bigquery/backfill.py | shahzadafarhad/cloud-dataproc | afca20a961e18c250d2d3fda4c9789afc3205b8c | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 35.561404 | 105 | 0.715836 |
import re
import time
import sys
from pyspark.sql import SparkSession
from pyspark.sql.functions import regexp_replace, col
# Library for interacting with Google Cloud Storage
from google.cloud import storage
# This will help catch some PySpark errors
from py4j.protocol import Py4JJavaError
# C... | true | true |
790cad625b83752558e458407119f7a5c61591ec | 20,194 | py | Python | inferlo/generic/libdai_bp.py | InferLO/inferlo | a65efce721d7f99d2f274dd94a1aaf7ca159e944 | [
"Apache-2.0"
] | 1 | 2022-01-27T18:44:07.000Z | 2022-01-27T18:44:07.000Z | inferlo/generic/libdai_bp.py | InferLO/inferlo | a65efce721d7f99d2f274dd94a1aaf7ca159e944 | [
"Apache-2.0"
] | 3 | 2022-01-23T18:02:30.000Z | 2022-01-27T23:10:51.000Z | inferlo/generic/libdai_bp.py | InferLO/inferlo | a65efce721d7f99d2f274dd94a1aaf7ca159e944 | [
"Apache-2.0"
] | 1 | 2021-09-03T06:12:57.000Z | 2021-09-03T06:12:57.000Z | # Copyright (c) 2020, The InferLO authors. All rights reserved.
# Licensed under the Apache License, Version 2.0 - see LICENSE file.
from __future__ import annotations
import random
import time
from dataclasses import dataclass
from typing import TYPE_CHECKING, List, Callable, Dict
import numpy as np
from inferlo.ba... | 35.932384 | 79 | 0.561305 |
from __future__ import annotations
import random
import time
from dataclasses import dataclass
from typing import TYPE_CHECKING, List, Callable, Dict
import numpy as np
from inferlo.base.factors.discrete_factor import DiscreteFactor
from inferlo.base import InferenceResult
if TYPE_CHECKING:
from inferlo impor... | true | true |
790cade744279e033d1a42616d9659dc6e2a347f | 421 | py | Python | project/partners/migrations/0009_partner_is_published.py | TEDxNTUA/tedxntua2019 | 6bce7c9dd8c4ee2c1a94b4ff6facb39052d41cff | [
"MIT"
] | 7 | 2018-10-09T19:14:37.000Z | 2019-11-25T13:43:38.000Z | project/partners/migrations/0009_partner_is_published.py | TEDxNTUA/tedxntua2019 | 6bce7c9dd8c4ee2c1a94b4ff6facb39052d41cff | [
"MIT"
] | 16 | 2018-11-01T21:42:17.000Z | 2019-03-10T16:59:25.000Z | project/partners/migrations/0009_partner_is_published.py | TEDxNTUA/tedxntua2019 | 6bce7c9dd8c4ee2c1a94b4ff6facb39052d41cff | [
"MIT"
] | 5 | 2018-10-28T17:33:06.000Z | 2018-11-22T00:12:55.000Z | # Generated by Django 2.1.2 on 2019-03-19 22:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('partners', '0008_merge_20190307_1527'),
]
operations = [
migrations.AddField(
model_name='partner',
name='is_publish... | 22.157895 | 78 | 0.619952 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('partners', '0008_merge_20190307_1527'),
]
operations = [
migrations.AddField(
model_name='partner',
name='is_published',
field=models.BooleanField(defa... | true | true |
790cafd39b27c239936e5f31977800b1240a68b4 | 2,682 | py | Python | sentence_transformers/losses/TripleSoftmaxLoss.py | jaimeenahn/COVID-sentence-bert | 2f47d116f7d9b774946fbf3c0724b721d1b88225 | [
"Apache-2.0"
] | null | null | null | sentence_transformers/losses/TripleSoftmaxLoss.py | jaimeenahn/COVID-sentence-bert | 2f47d116f7d9b774946fbf3c0724b721d1b88225 | [
"Apache-2.0"
] | null | null | null | sentence_transformers/losses/TripleSoftmaxLoss.py | jaimeenahn/COVID-sentence-bert | 2f47d116f7d9b774946fbf3c0724b721d1b88225 | [
"Apache-2.0"
] | null | null | null | import torch
from torch import nn, Tensor
from typing import Union, Tuple, List, Iterable, Dict
from ..SentenceTransformer import SentenceTransformer
import logging
class TripleSoftmaxLoss(nn.Module):
def __init__(self,
model: SentenceTransformer,
sentence_embedding_dimension: int... | 43.258065 | 121 | 0.670022 | import torch
from torch import nn, Tensor
from typing import Union, Tuple, List, Iterable, Dict
from ..SentenceTransformer import SentenceTransformer
import logging
class TripleSoftmaxLoss(nn.Module):
def __init__(self,
model: SentenceTransformer,
sentence_embedding_dimension: int... | true | true |
790cb0a489179a2e43dca813e26d4baa816f0c0d | 1,781 | py | Python | temoc.py | aaron-lebo/temoc | 9ade9fe1990378bec2be5a39d2bc5a53b01ed9ad | [
"0BSD"
] | null | null | null | temoc.py | aaron-lebo/temoc | 9ade9fe1990378bec2be5a39d2bc5a53b01ed9ad | [
"0BSD"
] | null | null | null | temoc.py | aaron-lebo/temoc | 9ade9fe1990378bec2be5a39d2bc5a53b01ed9ad | [
"0BSD"
] | null | null | null | import sqlite3
import time
import feedparser
import requests
subs = [x.strip() for x in open('subs.txt').readlines()]
con = sqlite3.connect('temoc.db')
cur = con.cursor()
try:
cur.execute('create table things(site, id text, utc timestamp, save integer, hide integer, title, url)')
cur.execute('create unique i... | 40.477273 | 114 | 0.619315 | import sqlite3
import time
import feedparser
import requests
subs = [x.strip() for x in open('subs.txt').readlines()]
con = sqlite3.connect('temoc.db')
cur = con.cursor()
try:
cur.execute('create table things(site, id text, utc timestamp, save integer, hide integer, title, url)')
cur.execute('create unique i... | true | true |
790cb1ee3c10ab4dc40e5147bd25197d42ed6ef0 | 3,237 | py | Python | game/AIRepository.py | AnythingTechPro/toontown-otp-original | 40749161f02c6f75844b1d072bf1498b42c2800d | [
"BSD-3-Clause"
] | 2 | 2019-12-05T01:07:38.000Z | 2021-02-25T06:00:47.000Z | game/AIRepository.py | rasheelprogrammer/toontown-otp-original | 40749161f02c6f75844b1d072bf1498b42c2800d | [
"BSD-3-Clause"
] | null | null | null | game/AIRepository.py | rasheelprogrammer/toontown-otp-original | 40749161f02c6f75844b1d072bf1498b42c2800d | [
"BSD-3-Clause"
] | 1 | 2021-02-25T06:00:48.000Z | 2021-02-25T06:00:48.000Z | from panda3d.core import *
from direct.distributed.PyDatagram import PyDatagram
from OTPInternalRepository import OTPInternalRepository
from direct.directnotify import DirectNotifyGlobal
from game.OtpDoGlobals import *
from realtime.types import *
from direct.distributed.AIZoneData import AIZoneDataStore
from game.Time... | 33.71875 | 107 | 0.713315 | from panda3d.core import *
from direct.distributed.PyDatagram import PyDatagram
from OTPInternalRepository import OTPInternalRepository
from direct.directnotify import DirectNotifyGlobal
from game.OtpDoGlobals import *
from realtime.types import *
from direct.distributed.AIZoneData import AIZoneDataStore
from game.Time... | false | true |
790cb21953992624cafa711ad382e9592b996752 | 1,401 | py | Python | datashader_nb.py | cisaacstern/hrpyzon | 10050b5286045f8a9a9d1338b5f4d418b19df39d | [
"BSD-3-Clause"
] | null | null | null | datashader_nb.py | cisaacstern/hrpyzon | 10050b5286045f8a9a9d1338b5f4d418b19df39d | [
"BSD-3-Clause"
] | null | null | null | datashader_nb.py | cisaacstern/hrpyzon | 10050b5286045f8a9a9d1338b5f4d418b19df39d | [
"BSD-3-Clause"
] | null | null | null | # +
import numpy as np
import holoviews as hv
from holoviews import opts
import matplotlib.pyplot as plt
from plotsun import plot_sun
hv.extension('bokeh', 'matplotlib')
# -
# # Load data
data = np.load('npz_timeseries/subset.npz')
arr = data['arr']
stack = data['stack']
sun = data['sun']
print(arr.shape, stack.sha... | 21.553846 | 73 | 0.589579 |
import numpy as np
import holoviews as hv
from holoviews import opts
import matplotlib.pyplot as plt
from plotsun import plot_sun
hv.extension('bokeh', 'matplotlib')
.load('npz_timeseries/subset.npz')
arr = data['arr']
stack = data['stack']
sun = data['sun']
print(arr.shape, stack.shape, sun.shape)
stack[:,:,25]
... | true | true |
790cb2a200277d0b74b3fa86c967d5890bbbc826 | 18,618 | py | Python | var/spack/repos/builtin/packages/lbann/package.py | edwardsp/spack | f42c5f62373e4c4ea1f21ebab1c9f54e92d9a535 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-10T13:47:48.000Z | 2019-04-17T13:05:17.000Z | var/spack/repos/builtin/packages/lbann/package.py | edwardsp/spack | f42c5f62373e4c4ea1f21ebab1c9f54e92d9a535 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 12 | 2021-02-15T15:55:08.000Z | 2022-03-31T00:09:57.000Z | var/spack/repos/builtin/packages/lbann/package.py | rubendibattista/spack | 91de23ce650ef4dd007b94f67c26e1e6901be354 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2018-04-06T09:04:11.000Z | 2020-01-24T12:52:12.000Z | # Copyright 2013-2021 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)
import os
from spack import *
class Lbann(CMakePackage, CudaPackage, ROCmPackage):
"""LBANN: Livermore Big Artificia... | 46.198511 | 99 | 0.615104 |
import os
from spack import *
class Lbann(CMakePackage, CudaPackage, ROCmPackage):
homepage = "http://software.llnl.gov/lbann/"
url = "https://github.com/LLNL/lbann/archive/v0.91.tar.gz"
git = "https://github.com/LLNL/lbann.git"
maintainers = ['bvanessen']
version('develop', bran... | true | true |
790cb2b72248c2c9cc20f3039a3954d558e9a846 | 1,534 | py | Python | source/_sample/pillow/pattern.py | showa-yojyo/notebook | 82c15074c24d64a1dfcb70a526bc1deb2ecffe68 | [
"MIT"
] | 14 | 2016-04-13T08:10:02.000Z | 2021-04-19T09:42:51.000Z | source/_sample/pillow/pattern.py | showa-yojyo/note | 5f262ecda3df132cb66206c465d16e174061d6b9 | [
"MIT"
] | 88 | 2017-09-27T15:07:05.000Z | 2019-10-02T04:05:03.000Z | source/_sample/pillow/pattern.py | showa-yojyo/note | 5f262ecda3df132cb66206c465d16e174061d6b9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""pattern.py: An example like <Rolling an image> in Pillow document.
"""
import os.path
from PIL import Image
def run(filepath):
"""Create a wallpaper image from a PNG file."""
src = Image.open(filepath)
target = swap_quadrants(src)
paste_with_alpha(target, src, (0, 0), 0x10)
... | 28.943396 | 71 | 0.632334 |
import os.path
from PIL import Image
def run(filepath):
src = Image.open(filepath)
target = swap_quadrants(src)
paste_with_alpha(target, src, (0, 0), 0x10)
return target
def swap_quadrants(img):
boxes = quarter_bbox(img)
regions = [img.crop(box) for box in boxes]
target = img.copy()
... | true | true |
790cb2eec66b03989bf4ebf69d545d5043aed7c3 | 20,545 | py | Python | purity_fb/purity_fb_1dot3/apis/network_interfaces_api.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 5 | 2017-09-08T20:47:22.000Z | 2021-06-29T02:11:05.000Z | purity_fb/purity_fb_1dot3/apis/network_interfaces_api.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 16 | 2017-11-27T20:57:48.000Z | 2021-11-23T18:46:43.000Z | purity_fb/purity_fb_1dot3/apis/network_interfaces_api.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 22 | 2017-10-13T15:33:05.000Z | 2021-11-08T19:56:21.000Z | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.3 Python SDK
Pure Storage FlashBlade REST 1.3 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.3
Contact: i... | 42.981172 | 204 | 0.585933 |
from __future__ import absolute_import
import sys
import os
import re
from six import iteritems
from ..configuration import Configuration
from ..api_client import ApiClient
class NetworkInterfacesApi(object):
def __init__(self, api_client=None):
config = Configuration()
if api_client:
... | true | true |
790cb498dc09adf0c96f4a0cfff49cf19147bee5 | 2,401 | py | Python | models/layers.py | yijingru/ObjGuided-Instance-Segmentation | 71e39f84aada581743a5d65f103e63ba0fcc8a9a | [
"MIT"
] | 9 | 2021-02-08T07:30:32.000Z | 2022-01-12T08:05:24.000Z | models/layers.py | yijingru/ObjGuided-Instance-Segmentation | 71e39f84aada581743a5d65f103e63ba0fcc8a9a | [
"MIT"
] | 1 | 2022-03-22T09:29:28.000Z | 2022-03-23T10:25:36.000Z | models/layers.py | yijingru/ObjGuided-Instance-Segmentation | 71e39f84aada581743a5d65f103e63ba0fcc8a9a | [
"MIT"
] | 3 | 2021-07-01T06:59:37.000Z | 2021-12-11T20:31:38.000Z | import torch.nn as nn
import torch
import torch.nn.functional as F
class CombinationModule(nn.Module):
def __init__(self, c_low, c_up, batch_norm=False, group_norm=False, instance_norm=False):
super(CombinationModule, self).__init__()
if batch_norm:
self.up = nn.Sequential(nn.Conv2d(c_... | 60.025 | 107 | 0.52853 | import torch.nn as nn
import torch
import torch.nn.functional as F
class CombinationModule(nn.Module):
def __init__(self, c_low, c_up, batch_norm=False, group_norm=False, instance_norm=False):
super(CombinationModule, self).__init__()
if batch_norm:
self.up = nn.Sequential(nn.Conv2d(c_... | true | true |
790cb5a1f9ec7ae8fa43c57b166e178006a478cc | 2,695 | py | Python | PyPoll/main.py | dorispira/python-challenge | 000516550a843265454fb069ec56082f70a10347 | [
"MIT"
] | null | null | null | PyPoll/main.py | dorispira/python-challenge | 000516550a843265454fb069ec56082f70a10347 | [
"MIT"
] | null | null | null | PyPoll/main.py | dorispira/python-challenge | 000516550a843265454fb069ec56082f70a10347 | [
"MIT"
] | null | null | null | import os
import csv
# File path
election_dataCSV = os.path.join('.', 'election_data.csv')
# The total number of votes cast
# A complete list of candidates who received votes
# The percentage of votes each candidate won
# The total number of votes each candidate won
# The winner of the election based on popular vote... | 30.625 | 171 | 0.621521 | import os
import csv
election_dataCSV = os.path.join('.', 'election_data.csv')
total_votes = 0
khan_votes = 0
correy_votes = 0
li_votes = 0
otooley_votes = 0
with open ('election_data.csv','r') as csvfile:
csvreader = csv.reader(csvfile, delimiter=',')
header = next(csvreader)
... | true | true |
790cb5b691044225ad777024cc19b9e693c1f668 | 1,253 | py | Python | vnpy_deribit/__init__.py | NovelResearchInvestment/vnpy_deribit | ea567c636b7712f63ab11a70e5b530b14ffc6dc8 | [
"MIT"
] | 7 | 2021-12-01T12:56:36.000Z | 2022-01-27T03:05:31.000Z | vnpy_deribit/__init__.py | NovelResearchInvestment/vnpy_deribit | ea567c636b7712f63ab11a70e5b530b14ffc6dc8 | [
"MIT"
] | null | null | null | vnpy_deribit/__init__.py | NovelResearchInvestment/vnpy_deribit | ea567c636b7712f63ab11a70e5b530b14ffc6dc8 | [
"MIT"
] | 4 | 2021-04-30T06:20:05.000Z | 2021-09-24T09:05:06.000Z | # The MIT License (MIT)
#
# Copyright (c) 2015-present, vn-crypto
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy... | 44.75 | 80 | 0.783719 |
from .deribit_gateway import DeribitGateway
import importlib_metadata
__version__ = importlib_metadata.version("vnpy_deribit") | true | true |
790cb5d1976b484d7e527c5d88ae7e59dabc39a2 | 48 | py | Python | samcli/__init__.py | HiteshMah-Jan/aws-sam-cli | 5cc7680068c820e972d6165a0cccd21677e2a428 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | samcli/__init__.py | HiteshMah-Jan/aws-sam-cli | 5cc7680068c820e972d6165a0cccd21677e2a428 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | samcli/__init__.py | HiteshMah-Jan/aws-sam-cli | 5cc7680068c820e972d6165a0cccd21677e2a428 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | """
SAM CLI version
"""
__version__ = "1.23.0"
| 8 | 22 | 0.583333 |
__version__ = "1.23.0"
| true | true |
790cb8607b4e97473cd8d77b572067bb176bd9e6 | 5,546 | py | Python | cubic_spline_planner.py | hadleyhzy34/mpc_python_traj | 48451533c7ecd473e949c3a680a166fb046447bf | [
"Apache-2.0"
] | null | null | null | cubic_spline_planner.py | hadleyhzy34/mpc_python_traj | 48451533c7ecd473e949c3a680a166fb046447bf | [
"Apache-2.0"
] | null | null | null | cubic_spline_planner.py | hadleyhzy34/mpc_python_traj | 48451533c7ecd473e949c3a680a166fb046447bf | [
"Apache-2.0"
] | null | null | null | """
Cubic spline planner
Author: Atsushi Sakai(@Atsushi_twi)
"""
import math
import numpy as np
import bisect
class Spline:
"""
Cubic Spline class
"""
def __init__(self, x, y):
self.b, self.c, self.d, self.w = [], [], [], []
self.x = x
self.y = y
self.nx = len(x) # ... | 23.400844 | 79 | 0.462495 | import math
import numpy as np
import bisect
class Spline:
def __init__(self, x, y):
self.b, self.c, self.d, self.w = [], [], [], []
self.x = x
self.y = y
self.nx = len(x)
h = np.diff(x)
self.a = [iy for iy in y]
A = self.__calc_A(h)... | true | true |
790cb87cb2bead4c83974996491b47adeb913907 | 788 | py | Python | maxipago/utils/xml.py | fdelvalle/sdk-python | e8457644ca7dba94e3dc1cd3ba5a100887d75d26 | [
"MIT"
] | 1 | 2019-06-04T19:18:00.000Z | 2019-06-04T19:18:00.000Z | maxipago/utils/xml.py | fdelvalle/sdk-python | e8457644ca7dba94e3dc1cd3ba5a100887d75d26 | [
"MIT"
] | null | null | null | maxipago/utils/xml.py | fdelvalle/sdk-python | e8457644ca7dba94e3dc1cd3ba5a100887d75d26 | [
"MIT"
] | 3 | 2018-02-22T18:45:42.000Z | 2022-03-24T15:08:07.000Z | # coding: utf-8
try:
from lxml import etree
except ImportError:
try:
# Python 2.5
import xml.etree.cElementTree as etree
except ImportError:
try:
# Python 2.5
import xml.etree.ElementTree as etree
except ImportError:
try:
#... | 24.625 | 55 | 0.558376 |
try:
from lxml import etree
except ImportError:
try:
import xml.etree.cElementTree as etree
except ImportError:
try:
import xml.etree.ElementTree as etree
except ImportError:
try:
import cElementTree as ... | true | true |
790cb8c9d2eff5586181d712f28e9160677d928c | 305 | py | Python | 2018/11/graphics/judges-trump-obama-20181113/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2018/11/graphics/judges-trump-obama-20181113/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2018/11/graphics/judges-trump-obama-20181113/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
import base_filters
COPY_GOOGLE_DOC_KEY = '1IrWnAyt2g0fMsCzCJImHZXgqXiwhyjPl4atT-n6MkkM'
USE_ASSETS = False
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
| 21.785714 | 77 | 0.816393 |
import base_filters
COPY_GOOGLE_DOC_KEY = '1IrWnAyt2g0fMsCzCJImHZXgqXiwhyjPl4atT-n6MkkM'
USE_ASSETS = False
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
| true | true |
790cb9aee9ca5d8aca1ae39b0c7d06ef3fe83b3d | 5,814 | py | Python | amazon_msk/datadog_checks/amazon_msk/config_models/defaults.py | mchelen-gov/integrations-core | 81281600b3cc7025a7a32148c59620c9592a564f | [
"BSD-3-Clause"
] | null | null | null | amazon_msk/datadog_checks/amazon_msk/config_models/defaults.py | mchelen-gov/integrations-core | 81281600b3cc7025a7a32148c59620c9592a564f | [
"BSD-3-Clause"
] | null | null | null | amazon_msk/datadog_checks/amazon_msk/config_models/defaults.py | mchelen-gov/integrations-core | 81281600b3cc7025a7a32148c59620c9592a564f | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from datadog_checks.base.utils.models.fields import get_default_field_value
def shared_proxy(field, value):
return get_default_field_value(field, value)
def shared_service(field, value):
return... | 20.4 | 75 | 0.78483 |
from datadog_checks.base.utils.models.fields import get_default_field_value
def shared_proxy(field, value):
return get_default_field_value(field, value)
def shared_service(field, value):
return get_default_field_value(field, value)
def shared_skip_proxy(field, value):
return False
def shared_time... | true | true |
790cb9e7ea467b8374fae87d05bb00d7f1e70de9 | 406 | py | Python | setup.py | knu2xs/business-analyst-python-api-examples | c2f17bc87195872183ecbcd998b4bb0e9c295761 | [
"Apache-2.0"
] | null | null | null | setup.py | knu2xs/business-analyst-python-api-examples | c2f17bc87195872183ecbcd998b4bb0e9c295761 | [
"Apache-2.0"
] | null | null | null | setup.py | knu2xs/business-analyst-python-api-examples | c2f17bc87195872183ecbcd998b4bb0e9c295761 | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages, setup
with open('README.md', 'r') as readme:
long_description = readme.read()
setup(
name='ba_samples',
package_dir={"": "src"},
packages=find_packages('src'),
version='0.1.0-dev0',
description='Examples using ArcGIS Business Analyst with Python.',
lon... | 25.375 | 70 | 0.684729 | from setuptools import find_packages, setup
with open('README.md', 'r') as readme:
long_description = readme.read()
setup(
name='ba_samples',
package_dir={"": "src"},
packages=find_packages('src'),
version='0.1.0-dev0',
description='Examples using ArcGIS Business Analyst with Python.',
lon... | true | true |
790cbaafc95480c008c978f76b5da45274318516 | 712 | py | Python | backend/category/urls.py | zerlee/open-cmdb | e05eeab70bf2c2e14603597bf99c45b6c3330d1e | [
"BSD-3-Clause"
] | 126 | 2019-09-17T17:49:35.000Z | 2022-03-31T13:34:35.000Z | backend/category/urls.py | tom2jack/open-cmdb | 68bc028d5d6162dbfa724d7bbf17363f65e44557 | [
"BSD-3-Clause"
] | 5 | 2020-01-19T08:43:38.000Z | 2021-06-10T21:58:30.000Z | backend/category/urls.py | tom2jack/open-cmdb | 68bc028d5d6162dbfa724d7bbf17363f65e44557 | [
"BSD-3-Clause"
] | 52 | 2019-09-20T06:10:32.000Z | 2022-03-31T13:34:28.000Z | # -*- coding: utf-8 -*-
from django.conf.urls import include
from django.conf.urls import url
from rest_framework.routers import DefaultRouter
from .views import *
# register的可选参数 base_name: 用来生成urls名字,如果viewset中没有包含queryset, base_name一定要有
router = DefaultRouter()
router.register(r'idcs', IdcViewSet)
router.register... | 30.956522 | 75 | 0.771067 |
from django.conf.urls import include
from django.conf.urls import url
from rest_framework.routers import DefaultRouter
from .views import *
router = DefaultRouter()
router.register(r'idcs', IdcViewSet)
router.register(r'racks', RackViewSet)
router.register(r'servers', ServerViewSet)
router.register(r'sshusers', SS... | true | true |
790cbc4dbf115b963041aacc79b8503ea8c2517c | 2,814 | py | Python | src/pal/automation/util.py | elinor-fung/coreclr | c1801e85024add717f518feb6a9caed60d54500f | [
"MIT"
] | 277 | 2015-01-04T20:42:36.000Z | 2022-03-21T06:52:03.000Z | src/pal/automation/util.py | elinor-fung/coreclr | c1801e85024add717f518feb6a9caed60d54500f | [
"MIT"
] | 31 | 2015-01-05T08:00:38.000Z | 2016-01-05T01:18:59.000Z | src/pal/automation/util.py | elinor-fung/coreclr | c1801e85024add717f518feb6a9caed60d54500f | [
"MIT"
] | 46 | 2015-01-21T00:41:59.000Z | 2021-03-23T07:00:01.000Z | import sys
import getopt
import os
import subprocess
import shutil
import logging as log
def Initialize(platform):
print "Initializing Workspace"
global workspace
workspace = os.environ['WORKSPACE']
if platform == "windows":
# Jenkins puts quotes in the path, which is wrong. Remove quotes.
... | 28.714286 | 135 | 0.563255 | import sys
import getopt
import os
import subprocess
import shutil
import logging as log
def Initialize(platform):
print "Initializing Workspace"
global workspace
workspace = os.environ['WORKSPACE']
if platform == "windows":
os.environ['PATH'] = os.environ['PATH'].replace('"','')
... | false | true |
790cbcde2692dc3349e1e263ee75240aff28ac95 | 24,971 | py | Python | examples/tutorial.py | CadenScharpf/manim-cs | 17a9717f5580addd7c534f05a3d92c962dbe80eb | [
"MIT"
] | 4 | 2019-03-18T02:39:00.000Z | 2021-12-15T20:39:15.000Z | examples/tutorial.py | CadenScharpf/manim-cs | 17a9717f5580addd7c534f05a3d92c962dbe80eb | [
"MIT"
] | 5 | 2021-03-18T22:49:37.000Z | 2022-03-11T23:41:59.000Z | examples/tutorial.py | CadenScharpf/manim-cs | 17a9717f5580addd7c534f05a3d92c962dbe80eb | [
"MIT"
] | null | null | null | from big_ol_pile_of_manim_imports import *
import os
import pyclbr
class Shapes(Scene):
#A few simple shapes
#Python 2.7 version runs in Python 3.7 without changes
def construct(self):
#circle = Circle()
#square = Square()
line=Line(UP,DOWN)
#line2=Line
#triangle=P... | 33.250333 | 245 | 0.593528 | from big_ol_pile_of_manim_imports import *
import os
import pyclbr
class Shapes(Scene):
def construct(self):
line=Line(UP,DOWN)
self.add(line)
class MoreShapes(Scene):
def construct(sel... | true | true |
790cbdab72f06ccb98ca8351a4a7986a172fc746 | 1,676 | py | Python | main.py | amanchourasiayt/Random-Number-in-Python | a656c686250269c4454b73b2988e5e5489b2e288 | [
"BSD-Source-Code"
] | 2 | 2021-07-23T02:51:53.000Z | 2021-07-24T10:17:05.000Z | main.py | amanchourasiayt/Random-Number-in-Python | a656c686250269c4454b73b2988e5e5489b2e288 | [
"BSD-Source-Code"
] | null | null | null | main.py | amanchourasiayt/Random-Number-in-Python | a656c686250269c4454b73b2988e5e5489b2e288 | [
"BSD-Source-Code"
] | null | null | null | # -----------------------------
# Copyright - This the Most Detailed Code fully written by the Owner of www.amanchourasia.in! This Code is fully Copyrighted by the Owner of www.amanchourasia.in! No one else wrote this code before!
# Disclaimer - This Code Contains Links, I am not responsible of ay damage caused by the... | 62.074074 | 403 | 0.741647 |
# If you want a detailed guide you can head on to this link - https://bit.ly/3y2jrNE.
import random
# Created a Number Variable which will store the random number, which will be generated by the randint function in the random module. There you'll also see that it is given (0,10) this mesans that the v... | true | true |
790cbdc03a680b0655ef8ffd488fef72b4107cef | 1,610 | py | Python | forms/migrations/0017_auto_20150331_1815.py | opendatadurban/gmmp | cc64fdedcf6e04b0377dc8ad7a7d34bae17ec575 | [
"Apache-2.0"
] | 4 | 2020-01-05T09:14:19.000Z | 2022-02-17T03:22:09.000Z | forms/migrations/0017_auto_20150331_1815.py | opendatadurban/gmmp | cc64fdedcf6e04b0377dc8ad7a7d34bae17ec575 | [
"Apache-2.0"
] | 68 | 2019-12-23T02:19:55.000Z | 2021-04-23T06:13:36.000Z | forms/migrations/0017_auto_20150331_1815.py | OpenUpSA/gmmp | d82a4be0787c3a3a9e27dc590d7974f9f884fbb6 | [
"Apache-2.0"
] | 2 | 2019-07-25T11:53:10.000Z | 2020-06-22T02:07:40.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('forms', '0016_auto_20150330_1413'),
]
operations = [
migrations.AlterField(
model_name='radiosheet',
... | 59.62963 | 532 | 0.560248 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('forms', '0016_auto_20150330_1413'),
]
operations = [
migrations.AlterField(
model_name='radiosheet',
name='item_number',
... | true | true |
790cbdf31ace28418522c7a2ba501d86db85af44 | 17,358 | py | Python | django/core/mail/message.py | bak1an/django | 98bcc5d81bca578f3a5b4d47907ba4ac40446887 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/core/mail/message.py | bak1an/django | 98bcc5d81bca578f3a5b4d47907ba4ac40446887 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/core/mail/message.py | bak1an/django | 98bcc5d81bca578f3a5b4d47907ba4ac40446887 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | import mimetypes
import os
from email import (
charset as Charset, encoders as Encoders, generator, message_from_string,
)
from email.errors import InvalidHeaderDefect, NonASCIILocalPartDefect
from email.header import Header
from email.headerregistry import Address
from email.message import Message
from email.mime.... | 37.982495 | 107 | 0.63308 | import mimetypes
import os
from email import (
charset as Charset, encoders as Encoders, generator, message_from_string,
)
from email.errors import InvalidHeaderDefect, NonASCIILocalPartDefect
from email.header import Header
from email.headerregistry import Address
from email.message import Message
from email.mime.... | true | true |
790cbe4553ca80d8b1222b2c52d90ca4f397e4cb | 3,769 | py | Python | tfx/components/pusher/executor_test.py | rmgogogo/tfx | 8ed47f2570bd01d258d8ee9b1ab001e08d16af89 | [
"Apache-2.0"
] | 1 | 2020-11-08T17:03:33.000Z | 2020-11-08T17:03:33.000Z | tfx/components/pusher/executor_test.py | rmgogogo/tfx | 8ed47f2570bd01d258d8ee9b1ab001e08d16af89 | [
"Apache-2.0"
] | null | null | null | tfx/components/pusher/executor_test.py | rmgogogo/tfx | 8ed47f2570bd01d258d8ee9b1ab001e08d16af89 | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2019 Google LLC. 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 req... | 40.967391 | 77 | 0.694879 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tensorflow as tf
from google.protobuf import json_format
from tfx.components.pusher import executor
from tfx.proto import pusher_pb2
from tfx.types import standard_artifacts
cl... | true | true |
790cbedeb8f640245205c0da49120cc0c06eac28 | 9,504 | py | Python | PyCTBN/tests/structure_graph/test_networkgraph.py | pietroepis/PyCTBN | 33e4cb5bd7dd68e3e272edfccb016806dd227deb | [
"MIT"
] | 1 | 2020-06-30T14:09:26.000Z | 2020-06-30T14:09:26.000Z | PyCTBN/tests/structure_graph/test_networkgraph.py | pietroepis/PyCTBN | 33e4cb5bd7dd68e3e272edfccb016806dd227deb | [
"MIT"
] | 1 | 2020-07-13T16:05:47.000Z | 2020-07-13T16:05:47.000Z | PyCTBN/tests/structure_graph/test_networkgraph.py | philipMartini/CTBN_Project | 235c85c8fad8a85f1243dac8162dda60bf45291b | [
"MIT"
] | 4 | 2021-03-10T10:16:10.000Z | 2021-05-12T12:36:27.000Z |
# License: MIT License
import unittest
import glob
import os
import networkx as nx
import numpy as np
import itertools
from ...PyCTBN.structure_graph.sample_path import SamplePath
from ...PyCTBN.structure_graph.network_graph import NetworkGraph
from ...PyCTBN.utility.json_importer import JsonImporter
class TestNe... | 48.989691 | 127 | 0.675295 |
import unittest
import glob
import os
import networkx as nx
import numpy as np
import itertools
from ...PyCTBN.structure_graph.sample_path import SamplePath
from ...PyCTBN.structure_graph.network_graph import NetworkGraph
from ...PyCTBN.utility.json_importer import JsonImporter
class TestNetworkGraph(unittest.Te... | true | true |
790cbfc64effd7e7fea37d991fbdd2800f2b59b0 | 1,019 | py | Python | example/unicorn/components/add_flavor.py | Franziskhan/django-unicorn | ac0bfdafda1e98bc32031e34f8bcc9cf712bc920 | [
"MIT"
] | null | null | null | example/unicorn/components/add_flavor.py | Franziskhan/django-unicorn | ac0bfdafda1e98bc32031e34f8bcc9cf712bc920 | [
"MIT"
] | null | null | null | example/unicorn/components/add_flavor.py | Franziskhan/django-unicorn | ac0bfdafda1e98bc32031e34f8bcc9cf712bc920 | [
"MIT"
] | null | null | null | from django_unicorn.components import QuerySetType, UnicornView
from example.coffee.models import Flavor, Taste
class AddFlavorView(UnicornView):
is_adding = False
flavors = None
flavor_qty = 1
flavor_id = None
def __init__(self, *args, **kwargs):
super().__init__(**kwargs) # calling supe... | 24.853659 | 67 | 0.60157 | from django_unicorn.components import QuerySetType, UnicornView
from example.coffee.models import Flavor, Taste
class AddFlavorView(UnicornView):
is_adding = False
flavors = None
flavor_qty = 1
flavor_id = None
def __init__(self, *args, **kwargs):
super().__init__(**kwargs)
self.... | true | true |
790cbfe885f74997947ecf49647ed445f57375d1 | 14,929 | py | Python | p2p/handshake.py | g-r-a-n-t/trinity | f108b6cd34ed9aabfcf9e235badd91597650ecd5 | [
"MIT"
] | null | null | null | p2p/handshake.py | g-r-a-n-t/trinity | f108b6cd34ed9aabfcf9e235badd91597650ecd5 | [
"MIT"
] | null | null | null | p2p/handshake.py | g-r-a-n-t/trinity | f108b6cd34ed9aabfcf9e235badd91597650ecd5 | [
"MIT"
] | null | null | null | import asyncio
import functools
import operator
from typing import (
cast,
Iterable,
NamedTuple,
Sequence,
Type,
Tuple,
)
from cached_property import cached_property
from eth_utils import (
ExtendedDebugLogger,
to_tuple,
)
from eth_utils.toolz import groupby, valmap
from eth_keys impo... | 37.890863 | 129 | 0.681224 | import asyncio
import functools
import operator
from typing import (
cast,
Iterable,
NamedTuple,
Sequence,
Type,
Tuple,
)
from cached_property import cached_property
from eth_utils import (
ExtendedDebugLogger,
to_tuple,
)
from eth_utils.toolz import groupby, valmap
from eth_keys impo... | true | true |
790cc11385a01d9ab155c4b02043db992f94b32d | 1,435 | py | Python | honeybot/plugins/google.py | marceloyb/honeybot | b2b92af54d01228ec150185eaa08a4baf55f1c88 | [
"MIT"
] | null | null | null | honeybot/plugins/google.py | marceloyb/honeybot | b2b92af54d01228ec150185eaa08a4baf55f1c88 | [
"MIT"
] | null | null | null | honeybot/plugins/google.py | marceloyb/honeybot | b2b92af54d01228ec150185eaa08a4baf55f1c88 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
[googleSearch.py]
Google Search Plugin
[Author]
Justin Walker
[About]
Returns the first three links from a google search.
[Commands]
>>> .google <<search term>>
returns search links
"""
try:
from googlesearch import search
except ImportError:
print("No modu... | 28.7 | 92 | 0.524739 |
try:
from googlesearch import search
except ImportError:
print("No module named 'google' found")
class Plugin:
def __init__(self):
pass
def __google(search_term):
return search(search_term, start=1, stop=3, \
only_sta... | true | true |
790cc141ab1b8956383f38a29e3b5d66b455a1b2 | 5,225 | py | Python | simsalabim/dinosaur_adapter.py | MatthewThe/spymsi | 1debdebbd09ba654923b034736f892e86a8414e6 | [
"Apache-2.0"
] | 1 | 2022-01-08T16:17:42.000Z | 2022-01-08T16:17:42.000Z | simsalabim/dinosaur_adapter.py | MatthewThe/spymsi | 1debdebbd09ba654923b034736f892e86a8414e6 | [
"Apache-2.0"
] | null | null | null | simsalabim/dinosaur_adapter.py | MatthewThe/spymsi | 1debdebbd09ba654923b034736f892e86a8414e6 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import sys
import os
import subprocess
from .simsalabim import __version__, __copyright__
from . import add_quant_info as quant
from . import helpers
def main(argv):
print('dinosaur-adapter version %s\n%s' % (__version__, __copyright__))
print('Issued command:', os.path.base... | 47.5 | 176 | 0.622775 | from __future__ import print_function
import sys
import os
import subprocess
from .simsalabim import __version__, __copyright__
from . import add_quant_info as quant
from . import helpers
def main(argv):
print('dinosaur-adapter version %s\n%s' % (__version__, __copyright__))
print('Issued command:', os.path.base... | true | true |
790cc1a21fa6d41fe95ae8781ba045a5f03f0b62 | 7,896 | py | Python | sdk/python/pulumi_azure_nextgen/eventgrid/get_event_channel.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/eventgrid/get_event_channel.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/eventgrid/get_event_channel.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # 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 ... | 41.557895 | 247 | 0.691109 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from . import outputs
__all__ = [
'GetEventChannelResult',
'AwaitableGetEventChannelResult',
'get_event_channel',
]
@pulumi.output_type
class GetEventChanne... | true | true |
790cc3972cbf74b7f562425bacf2d9ac81d4ef1a | 3,169 | py | Python | server/tests/integration/test_dataset_upload.py | maxpark/dive | 5dce25822d9b53d96ff0c2c8fb02265e4b43911e | [
"Apache-2.0"
] | null | null | null | server/tests/integration/test_dataset_upload.py | maxpark/dive | 5dce25822d9b53d96ff0c2c8fb02265e4b43911e | [
"Apache-2.0"
] | null | null | null | server/tests/integration/test_dataset_upload.py | maxpark/dive | 5dce25822d9b53d96ff0c2c8fb02265e4b43911e | [
"Apache-2.0"
] | null | null | null | import json
from girder.constants import AccessType
from girder_client import HttpError
import pytest
from .conftest import getClient, getTestFolder, localDataRoot, users, wait_for_jobs
@pytest.mark.integration
@pytest.mark.parametrize("user", users.values())
@pytest.mark.run(order=3)
def test_reset_integration_env... | 38.180723 | 97 | 0.546229 | import json
from girder.constants import AccessType
from girder_client import HttpError
import pytest
from .conftest import getClient, getTestFolder, localDataRoot, users, wait_for_jobs
@pytest.mark.integration
@pytest.mark.parametrize("user", users.values())
@pytest.mark.run(order=3)
def test_reset_integration_env... | true | true |
790cc39c12fa89c6948cffb05bfafa9131ed6db1 | 1,655 | py | Python | controller/class_converter.py | EmilRyberg/P6BinPicking | c33b650db3ae16c56d46d12bfbc59d26c0d9e6aa | [
"MIT"
] | 1 | 2021-08-04T16:18:22.000Z | 2021-08-04T16:18:22.000Z | controller/class_converter.py | EmilRyberg/P6BinPicking | c33b650db3ae16c56d46d12bfbc59d26c0d9e6aa | [
"MIT"
] | null | null | null | controller/class_converter.py | EmilRyberg/P6BinPicking | c33b650db3ae16c56d46d12bfbc59d26c0d9e6aa | [
"MIT"
] | 1 | 2021-08-03T03:41:41.000Z | 2021-08-03T03:41:41.000Z | from controller.enums import PartEnum
def convert_from_part_id(part_id):
if part_id == PartEnum.FUSE.value:
return 'Fuse', 'Fuse'
elif part_id == PartEnum.BACKCOVER.value:
return 'BottomCover', 'BottomCoverFlipped'
elif part_id == PartEnum.WHITECOVER.value:
return 'WhiteCover', 'Wh... | 34.479167 | 50 | 0.682175 | from controller.enums import PartEnum
def convert_from_part_id(part_id):
if part_id == PartEnum.FUSE.value:
return 'Fuse', 'Fuse'
elif part_id == PartEnum.BACKCOVER.value:
return 'BottomCover', 'BottomCoverFlipped'
elif part_id == PartEnum.WHITECOVER.value:
return 'WhiteCover', 'Wh... | true | true |
790cc3aaa9deb871de96be4fd40b9fbe3b566426 | 3,715 | py | Python | python_module/sirius/ot/ot_precondition.py | mtaillefumier/SIRIUS | 50ec1c202c019113c5660f1966b170dec9dfd4d4 | [
"BSD-2-Clause"
] | 77 | 2016-03-18T08:38:30.000Z | 2022-03-11T14:06:25.000Z | python_module/sirius/ot/ot_precondition.py | simonpintarelli/SIRIUS | f4b5c4810af2a3ea1e67992d65750535227da84b | [
"BSD-2-Clause"
] | 240 | 2016-04-12T16:39:11.000Z | 2022-03-31T08:46:12.000Z | python_module/sirius/ot/ot_precondition.py | simonpintarelli/SIRIUS | f4b5c4810af2a3ea1e67992d65750535227da84b | [
"BSD-2-Clause"
] | 43 | 2016-03-18T17:45:07.000Z | 2022-02-28T05:27:59.000Z | from ..coefficient_array import PwCoeffs
from scipy.sparse import dia_matrix
import numpy as np
def make_kinetic_precond(kpointset, c0, eps=0.1, asPwCoeffs=True):
"""
Preconditioner
P = 1 / (||k|| + ε)
Keyword Arguments:
kpointset --
"""
nk = len(kpointset)
nc = kpointset.ctx().num_s... | 26.92029 | 91 | 0.544818 | from ..coefficient_array import PwCoeffs
from scipy.sparse import dia_matrix
import numpy as np
def make_kinetic_precond(kpointset, c0, eps=0.1, asPwCoeffs=True):
nk = len(kpointset)
nc = kpointset.ctx().num_spins()
if nc == 1 and nk == 1 and not asPwCoeffs:
kp = kpointset[0]
gkv... | true | true |
790cc3d297af72c200291c7f356793f2b038cd2b | 5,814 | py | Python | exchangelib/services/get_server_time_zones.py | monperrus/exchangelib-1 | 31f5ea9150ab724305a6cf7b0fef745d1cb9bfb8 | [
"BSD-2-Clause"
] | null | null | null | exchangelib/services/get_server_time_zones.py | monperrus/exchangelib-1 | 31f5ea9150ab724305a6cf7b0fef745d1cb9bfb8 | [
"BSD-2-Clause"
] | null | null | null | exchangelib/services/get_server_time_zones.py | monperrus/exchangelib-1 | 31f5ea9150ab724305a6cf7b0fef745d1cb9bfb8 | [
"BSD-2-Clause"
] | null | null | null | import datetime
from ..errors import NaiveDateTimeNotAllowed
from ..ewsdatetime import EWSDateTime
from ..util import create_element, set_xml_value, xml_text_to_value, peek, TNS, MNS
from ..version import EXCHANGE_2010
from .common import EWSService
class GetServerTimeZones(EWSService):
"""
MSDN: https://msd... | 50.12069 | 117 | 0.596491 | import datetime
from ..errors import NaiveDateTimeNotAllowed
from ..ewsdatetime import EWSDateTime
from ..util import create_element, set_xml_value, xml_text_to_value, peek, TNS, MNS
from ..version import EXCHANGE_2010
from .common import EWSService
class GetServerTimeZones(EWSService):
SERVICE_NAME = 'GetServer... | true | true |
790cc54f26c5872213e9b1fdae32c9e73fd69e15 | 1,436 | py | Python | app.py | aws-samples/aws-securityhub-falco-ecs-eks-integration | cb667031e043154f3702926983338e8dcb1afa80 | [
"MIT-0"
] | 2 | 2021-12-18T17:30:39.000Z | 2022-02-23T02:54:40.000Z | app.py | aws-samples/aws-securityhub-falco-ecs-eks-integration | cb667031e043154f3702926983338e8dcb1afa80 | [
"MIT-0"
] | 1 | 2022-02-02T17:30:19.000Z | 2022-02-07T16:23:28.000Z | app.py | aws-samples/aws-securityhub-falco-ecs-eks-integration | cb667031e043154f3702926983338e8dcb1afa80 | [
"MIT-0"
] | null | null | null | #!/usr/bin/env python3
import os
from aws_cdk import core as cdk
# For consistency with TypeScript code, `cdk` is the preferred import name for
# the CDK's core module. The following line also imports it as `core` for use
# with examples from the CDK Developer's Guide, which are in the process of
# being updated to ... | 41.028571 | 143 | 0.769499 |
import os
from aws_cdk import core as cdk
# with examples from the CDK Developer's Guide, which are in the process of
from aws_cdk import core
from aws_securityhub_falco_ecs_eks_integration.aws_securityhub_falco_ecs_eks_integration_stack import AwsSecurityhubFalcoEcsEksIntegrationStack
app = core.App()
AwsSecu... | true | true |
790cc6aa3346fa4c31e448d5bb45da8672d921a8 | 4,495 | py | Python | zPE/base/pgm/asma90_err_code_rc.py | T-Tony-T/mainframe-env-simulator | 9ca8b726b5962502d53c7e8483c5e4fd89ce5ac6 | [
"BSD-3-Clause"
] | 3 | 2015-07-20T20:11:38.000Z | 2019-07-17T01:53:50.000Z | zPE/base/pgm/asma90_err_code_rc.py | T-Tony-T/mainframe-env-simulator | 9ca8b726b5962502d53c7e8483c5e4fd89ce5ac6 | [
"BSD-3-Clause"
] | null | null | null | zPE/base/pgm/asma90_err_code_rc.py | T-Tony-T/mainframe-env-simulator | 9ca8b726b5962502d53c7e8483c5e4fd89ce5ac6 | [
"BSD-3-Clause"
] | 2 | 2019-11-14T14:40:09.000Z | 2021-01-21T21:58:58.000Z | __I_MSG = { # ASMAxxxI
33 : lambda info, line: 'Storage alignment for {0} unfavorable'.format(line[info[1]:info[2]]),
}
__N_MSG = { # ASMAxxxN
}
__W_MSG = { # ASMAxxxW
45 : lambda info, line: 'Register or label not previously used - {0}'.fo... | 59.933333 | 141 | 0.63337 | __I_MSG = {
33 : lambda info, line: 'Storage alignment for {0} unfavorable'.format(line[info[1]:info[2]]),
}
__N_MSG = {
}
__W_MSG = {
45 : lambda info, line: 'Register or label not previously used - {0}'.format(line[info[1]:info[2]]),
... | true | true |
790cc84a59e11e67b64e3d5cb5453ba06c847a06 | 404 | py | Python | invenio_subjects_mesh/version.py | fenekku/invenio-subjects-mesh | acdda73f2f1c2235292c0c4a0c9ec55263003066 | [
"MIT"
] | 1 | 2022-03-08T22:36:26.000Z | 2022-03-08T22:36:26.000Z | invenio_subjects_mesh/version.py | fenekku/invenio-subjects-mesh | acdda73f2f1c2235292c0c4a0c9ec55263003066 | [
"MIT"
] | 3 | 2021-06-29T13:50:28.000Z | 2021-06-29T18:27:55.000Z | invenio_subjects_mesh/version.py | fenekku/invenio-subjects-mesh | acdda73f2f1c2235292c0c4a0c9ec55263003066 | [
"MIT"
] | 1 | 2021-06-29T19:36:31.000Z | 2021-06-29T19:36:31.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021 Northwestern University.
#
# invenio-subjects-mesh is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""Version information for invenio-subjects-mesh.
This file is imported by ``invenio_s... | 25.25 | 73 | 0.725248 |
__version__ = '2021.7.13'
| true | true |
790cc8bdf4a2b7aed3f5cca024ee412ef8785951 | 5,925 | py | Python | wiking/migrations/0004_auto__add_field_comment_article_version.py | srisankethu/opengift.io | fc490332bd0252610b55a68c1fff1c4f704fcbd4 | [
"Apache-2.0"
] | 1 | 2020-08-30T23:12:08.000Z | 2020-08-30T23:12:08.000Z | wiking/migrations/0004_auto__add_field_comment_article_version.py | lenarhus/opengift.io | db37494eac141e795c8d9d5b262d54cd6f20fb15 | [
"Apache-2.0"
] | null | null | null | wiking/migrations/0004_auto__add_field_comment_article_version.py | lenarhus/opengift.io | db37494eac141e795c8d9d5b262d54cd6f20fb15 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Comment.article_version'
db.add_column(u'wiking_comment',... | 68.103448 | 187 | 0.571983 |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.add_column(u'wiking_comment', 'article_version',
self.gf('django.db.mo... | true | true |
790cc8c335ca80768ee9ce3d02a3b769ea21dfce | 38,417 | py | Python | r2r_src/agent.py | rcorona/R2R-EnvDrop | e91c21283ffc309bedfe49596b4066afa338fde6 | [
"MIT-0",
"MIT"
] | null | null | null | r2r_src/agent.py | rcorona/R2R-EnvDrop | e91c21283ffc309bedfe49596b4066afa338fde6 | [
"MIT-0",
"MIT"
] | null | null | null | r2r_src/agent.py | rcorona/R2R-EnvDrop | e91c21283ffc309bedfe49596b4066afa338fde6 | [
"MIT-0",
"MIT"
] | null | null | null |
import json
import os
import sys
import numpy as np
import random
import math
import time
from tqdm import tqdm
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch import optim
import torch.nn.functional as F
from env import R2RBatch
from utils import padding_idx, add_idx, Tokenizer
imp... | 44.722934 | 145 | 0.532655 |
import json
import os
import sys
import numpy as np
import random
import math
import time
from tqdm import tqdm
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch import optim
import torch.nn.functional as F
from env import R2RBatch
from utils import padding_idx, add_idx, Tokenizer
imp... | true | true |
790cc949e50ab6912df998fbdc372c01c447156f | 1,934 | py | Python | components/aws/sagemaker/tests/integration_tests/utils/kfp_client_utils.py | Intellicode/pipelines | f1d90407a8a2f56db11199c9c73e6df6c4a8b093 | [
"Apache-2.0"
] | 1 | 2020-10-13T13:28:42.000Z | 2020-10-13T13:28:42.000Z | components/aws/sagemaker/tests/integration_tests/utils/kfp_client_utils.py | Intellicode/pipelines | f1d90407a8a2f56db11199c9c73e6df6c4a8b093 | [
"Apache-2.0"
] | null | null | null | components/aws/sagemaker/tests/integration_tests/utils/kfp_client_utils.py | Intellicode/pipelines | f1d90407a8a2f56db11199c9c73e6df6c4a8b093 | [
"Apache-2.0"
] | null | null | null | import os
import utils
import pytest
from utils import argo_utils
def compile_and_run_pipeline(
client,
experiment_id,
pipeline_definition,
input_params,
output_file_dir,
pipeline_name,
):
pipeline_path = os.path.join(output_file_dir, pipeline_name)
utils.run_command(
f"dsl-co... | 26.493151 | 93 | 0.701138 | import os
import utils
import pytest
from utils import argo_utils
def compile_and_run_pipeline(
client,
experiment_id,
pipeline_definition,
input_params,
output_file_dir,
pipeline_name,
):
pipeline_path = os.path.join(output_file_dir, pipeline_name)
utils.run_command(
f"dsl-co... | true | true |
790cca98712755173d39f9bcd58d99751d1d3c8b | 8,255 | py | Python | app/resources/pymo/pymo/parsers.py | seanschneeweiss/RoSeMotion | 4ef7997c8976a8489798a427c768af5114f6b31e | [
"MIT"
] | 11 | 2021-01-03T07:31:56.000Z | 2022-03-26T20:21:25.000Z | app/resources/pymo/pymo/parsers.py | seanschneeweiss/RoSeMotion | 4ef7997c8976a8489798a427c768af5114f6b31e | [
"MIT"
] | 5 | 2021-01-04T07:22:32.000Z | 2022-02-01T00:38:52.000Z | app/resources/pymo/pymo/parsers.py | seanschneeweiss/RoSeMotion | 4ef7997c8976a8489798a427c768af5114f6b31e | [
"MIT"
] | 3 | 2021-03-06T17:00:26.000Z | 2022-01-18T01:37:43.000Z | '''
BVH Parser Class
By Omid Alemi
Created: June 12, 2017
Based on: https://gist.github.com/johnfredcee/2007503
'''
import re
import numpy as np
from data import Joint, MocapData
class BVHScanner:
'''
A wrapper class for re.Scanner
'''
def __init__(self):
def identifier(scanner, token):
... | 33.831967 | 152 | 0.586796 | import re
import numpy as np
from data import Joint, MocapData
class BVHScanner:
def __init__(self):
def identifier(scanner, token):
return 'IDENT', token
def operator(scanner, token):
return 'OPERATOR', token
def digit(scanner, token):
return 'DIGIT'... | true | true |
790ccaef13b8a06d76ca10c214ed5313b78c3fd5 | 8,543 | py | Python | armi/utils/directoryChangers.py | wilcoxjd/armi | 6de79e77bd2e58625efce8e9d9914cfd6cd3952a | [
"Apache-2.0"
] | null | null | null | armi/utils/directoryChangers.py | wilcoxjd/armi | 6de79e77bd2e58625efce8e9d9914cfd6cd3952a | [
"Apache-2.0"
] | null | null | null | armi/utils/directoryChangers.py | wilcoxjd/armi | 6de79e77bd2e58625efce8e9d9914cfd6cd3952a | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 TerraPower, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 33.766798 | 97 | 0.64626 |
import os
import random
import shutil
import string
import armi
from armi import runLog
from armi.utils import pathTools
def _changeDirectory(destination):
if os.path.exists(destination):
os.chdir(destination)
else:
raise IOError(
"Cannot change directory to non-exis... | true | true |
790ccb73ab0335237d3cdf89c049d0689a78a21f | 4,741 | py | Python | test/test_cdf.py | li012589/NeuralWavelet | 6e593ded5cb4ae80579cbf56eb9c346d808669cb | [
"Apache-2.0"
] | 28 | 2021-01-27T00:41:40.000Z | 2022-02-14T10:11:51.000Z | test/test_cdf.py | li012589/NeuralWavelet | 6e593ded5cb4ae80579cbf56eb9c346d808669cb | [
"Apache-2.0"
] | null | null | null | test/test_cdf.py | li012589/NeuralWavelet | 6e593ded5cb4ae80579cbf56eb9c346d808669cb | [
"Apache-2.0"
] | 6 | 2021-02-03T01:42:08.000Z | 2021-12-03T17:47:19.000Z |
import os
import sys
sys.path.append(os.getcwd())
import numpy as np
import torch
import flow
from utils import cdfDiscreteLogitstic, cdfMixDiscreteLogistic
from utils import logDiscreteLogistic, logMixDiscreteLogistic
nbins = 4096
_bins = torch.arange(-nbins // 2, nbins // 2).reshape(-1, 1, 1, 1, 1)
decimal = flow.... | 36.19084 | 125 | 0.494832 |
import os
import sys
sys.path.append(os.getcwd())
import numpy as np
import torch
import flow
from utils import cdfDiscreteLogitstic, cdfMixDiscreteLogistic
from utils import logDiscreteLogistic, logMixDiscreteLogistic
nbins = 4096
_bins = torch.arange(-nbins // 2, nbins // 2).reshape(-1, 1, 1, 1, 1)
decimal = flow.... | true | true |
790ccbf04d0a0c8937f8e6013f1a21b3be29c911 | 8,889 | py | Python | nixnet/database/_subframe.py | ni-ldp/nixnet-python | 83f30c5b44098de0dc4828838e263b7be0866228 | [
"MIT"
] | 16 | 2017-06-14T19:44:45.000Z | 2022-02-06T15:14:52.000Z | nixnet/database/_subframe.py | ni-ldp/nixnet-python | 83f30c5b44098de0dc4828838e263b7be0866228 | [
"MIT"
] | 216 | 2017-06-15T16:41:10.000Z | 2021-09-23T23:00:50.000Z | nixnet/database/_subframe.py | ni-ldp/nixnet-python | 83f30c5b44098de0dc4828838e263b7be0866228 | [
"MIT"
] | 23 | 2017-06-14T22:51:08.000Z | 2022-03-03T03:04:40.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import typing # NOQA: F401
from nixnet import _cconsts
from nixnet import _errors
from nixnet import _props
from nixnet import constants
from nixnet.database import _collection
from nixnet.database import _d... | 38.647826 | 118 | 0.657779 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import typing
from nixnet import _cconsts
from nixnet import _errors
from nixnet import _props
from nixnet import constants
from nixnet.database import _collection
from nixnet.database import _database_obje... | true | true |
790cccf2c4d720eb44d91f23e94c4eb73b9788d1 | 3,201 | py | Python | chb/util/dotutil.py | kestreltechnology/CodeHawk-Binary | aa0b2534e0318e5fb3770ec7b4d78feb0feb2394 | [
"MIT"
] | null | null | null | chb/util/dotutil.py | kestreltechnology/CodeHawk-Binary | aa0b2534e0318e5fb3770ec7b4d78feb0feb2394 | [
"MIT"
] | null | null | null | chb/util/dotutil.py | kestreltechnology/CodeHawk-Binary | aa0b2534e0318e5fb3770ec7b4d78feb0feb2394 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
# CodeHawk Binary Analyzer
# Author: Henny Sipma
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2016-2020 Kestrel Technology LLC
# Copyright (c) 2020 Henny Si... | 36.375 | 80 | 0.634177 |
import os
import subprocess
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from chb.util.DotGraph import DotGraph
def print_dot(
path: str,
filename: str,
g: "DotGraph") -> str:
if not os.path.isabs(filename):
filename = os.path.join(path, fil... | true | true |
790ccddf625df7077e9f9cd8d1083aa2f99c21c0 | 1,286 | py | Python | src/bos/operators/utils/clients/bos/__init__.py | Cray-HPE/bos | a4a7fc58c884d951b6051093e1a4e2aeaba6740f | [
"MIT"
] | 1 | 2022-03-15T18:17:11.000Z | 2022-03-15T18:17:11.000Z | src/bos/operators/utils/clients/bos/__init__.py | Cray-HPE/bos | a4a7fc58c884d951b6051093e1a4e2aeaba6740f | [
"MIT"
] | null | null | null | src/bos/operators/utils/clients/bos/__init__.py | Cray-HPE/bos | a4a7fc58c884d951b6051093e1a4e2aeaba6740f | [
"MIT"
] | 1 | 2022-03-06T12:47:06.000Z | 2022-03-06T12:47:06.000Z | # Copyright 2021 Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modif... | 47.62963 | 76 | 0.773717 |
from bos.operators.utils import PROTOCOL
API_VERSION = 'v1'
SERVICE_NAME = 'cray-bos'
ENDPOINT = "%s://%s/%s" % (PROTOCOL, SERVICE_NAME, API_VERSION)
| true | true |
790ccece6af78a479088fbc4ad29bcc5905f31d8 | 352 | py | Python | anaconda/6.00.1x.PSet1.P1.py | coshkun/6.00.1x-MITx-Course-Training-Lab-Notes | 63e755dc81fd50a7b1372074a4a73e50021a233b | [
"MIT"
] | null | null | null | anaconda/6.00.1x.PSet1.P1.py | coshkun/6.00.1x-MITx-Course-Training-Lab-Notes | 63e755dc81fd50a7b1372074a4a73e50021a233b | [
"MIT"
] | null | null | null | anaconda/6.00.1x.PSet1.P1.py | coshkun/6.00.1x-MITx-Course-Training-Lab-Notes | 63e755dc81fd50a7b1372074a4a73e50021a233b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Feb 12 11:56:36 2017
Problemset1 - Problem 1
Note:
's' is given by system like s = 'azcbobobegghakl'
@author: coskun
"""
s = 'azcbobobegghakl'
# Paste your code into this box
nvl=0
for c in s:
if c=='a' or c=='e' or c=='i' or c=='o' or c=='u':
nvl += 1
print(... | 22 | 54 | 0.590909 |
s = 'azcbobobegghakl'
nvl=0
for c in s:
if c=='a' or c=='e' or c=='i' or c=='o' or c=='u':
nvl += 1
print("Number of vowels: " + str(nvl)) | true | true |
790ccf1f2beb415d25e395355cb51083863e7fb0 | 2,566 | py | Python | source/FAST/Examples/Python/pyfast_and_pyside2_custom_window.py | andreped/FAST | 361819190ea0ae5a2f068e7bd808a1c70af5a171 | [
"BSD-2-Clause"
] | null | null | null | source/FAST/Examples/Python/pyfast_and_pyside2_custom_window.py | andreped/FAST | 361819190ea0ae5a2f068e7bd808a1c70af5a171 | [
"BSD-2-Clause"
] | null | null | null | source/FAST/Examples/Python/pyfast_and_pyside2_custom_window.py | andreped/FAST | 361819190ea0ae5a2f068e7bd808a1c70af5a171 | [
"BSD-2-Clause"
] | null | null | null | ## @example pyfast_and_pyside2_custom_window.py
# This example demonstrates how to use FAST in an existing PySide2 application.
#
# @m_class{m-block m-warning} @par PySide2 Qt Version
# @parblock
# For this example you <b>must</b> use the same Qt version of PySide2 as used in FAST (5.14.0)
# Do this with: <b>pi... | 32.897436 | 109 | 0.693687 | m PySide2.QtOpenGL import QGLWidget
from PySide2.QtCore import Slot
import PySide2.QtSvg
from shiboken2 import wrapInstance
import fast
import threading
import sys
class Window(QWidget):
def __init__(self):
super(Window, self).__init__()
self.setWindowTitle('pyFAST + PySide2')
... | true | true |
790cd075c19b673485ce18212759c2af68ca0bb6 | 10,825 | py | Python | tvdb_api/models/movie.py | h3llrais3r/tvdbapi-v2-client | 1210df9dd5869ccc5b63149b1b80630310a14f40 | [
"MIT"
] | 2 | 2021-01-24T07:45:22.000Z | 2021-11-15T11:29:25.000Z | tvdb_api/models/movie.py | h3llrais3r/tvdb_api_v2 | 1210df9dd5869ccc5b63149b1b80630310a14f40 | [
"MIT"
] | null | null | null | tvdb_api/models/movie.py | h3llrais3r/tvdb_api_v2 | 1210df9dd5869ccc5b63149b1b80630310a14f40 | [
"MIT"
] | 1 | 2020-05-07T10:16:15.000Z | 2020-05-07T10:16:15.000Z | # coding: utf-8
"""
TheTVDB API v2
API v3 targets v2 functionality with a few minor additions. The API is accessible via https://api.thetvdb.com and provides the following REST endpoints in JSON format. How to use this API documentation ---------------- You may browse the API routes without authentication... | 30.928571 | 2,040 | 0.591132 |
import pprint
import re
import six
class Movie(object):
swagger_types = {
'artworks': 'list[MovieArtwork]',
'genres': 'list[MovieGenre]',
'id': 'int',
'people': 'MoviePeople',
'release_dates': 'list[MovieReleaseDate]',
'remoteids': 'list[MovieRemoteId]',
... | true | true |
790cd132c4483bca78043365a481b7ec7d11cbe9 | 2,367 | py | Python | qiskit_aqua/algorithms/components/optimizers/nlopts/esch.py | msoeken/aqua | af6a459621bcee90ed832a644ef9220644b84b03 | [
"Apache-2.0"
] | null | null | null | qiskit_aqua/algorithms/components/optimizers/nlopts/esch.py | msoeken/aqua | af6a459621bcee90ed832a644ef9220644b84b03 | [
"Apache-2.0"
] | null | null | null | qiskit_aqua/algorithms/components/optimizers/nlopts/esch.py | msoeken/aqua | af6a459621bcee90ed832a644ef9220644b84b03 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018 IBM.
#
# 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 agre... | 32.875 | 119 | 0.636248 |
from qiskit_aqua.algorithms.components.optimizers import Optimizer
from ._nloptimizer import minimize
import logging
try:
import nlopt
except ImportError:
raise ImportWarning('nlopt cannot be imported')
logger = logging.getLogger(__name__)
class ESCH(Optimizer):
ESCH_CONFIGURATION = {... | true | true |
790cd19ca8b22937365bf24b6e40ed90c79ee12b | 1,301 | py | Python | tests/cache_tests.py | valhallasw/pywikibot-core | 32a8c3c1298a5cb077381fe202daefde82c1c5d3 | [
"MIT"
] | null | null | null | tests/cache_tests.py | valhallasw/pywikibot-core | 32a8c3c1298a5cb077381fe202daefde82c1c5d3 | [
"MIT"
] | null | null | null | tests/cache_tests.py | valhallasw/pywikibot-core | 32a8c3c1298a5cb077381fe202daefde82c1c5d3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""API Request cache tests."""
#
# (C) Pywikibot team, 2012-2014
#
# Distributed under the terms of the MIT license.
#
from __future__ import unicode_literals
__version__ = '$Id: 790cd19ca8b22937365bf24b6e40ed90c79ee12b $'
#
from pywikibot.site import BaseSite
import scripts.maintenance.cache... | 28.911111 | 76 | 0.707917 |
from __future__ import unicode_literals
__version__ = '$Id: 790cd19ca8b22937365bf24b6e40ed90c79ee12b $'
from pywikibot.site import BaseSite
import scripts.maintenance.cache as cache
from tests import _cache_dir
from tests.aspects import unittest, TestCase
class RequestCacheTests(TestCase):
net = False... | true | true |
790cd20955ec12b08cb4a8d15625f8fda87894b3 | 1,188 | py | Python | floodsystem/flood.py | LakeeSiv/Flood | d6bc5bccb04711de99714ecb279d9896c47c4f07 | [
"MIT"
] | null | null | null | floodsystem/flood.py | LakeeSiv/Flood | d6bc5bccb04711de99714ecb279d9896c47c4f07 | [
"MIT"
] | null | null | null | floodsystem/flood.py | LakeeSiv/Flood | d6bc5bccb04711de99714ecb279d9896c47c4f07 | [
"MIT"
] | null | null | null |
from .station import consistant_typical_range_stations
def stations_level_over_threshold(stations: list, tol: float) -> list:
"""function takes in stations and returns a list of tuples contating station and
relative water lever where the relative water level greater than tol """
stations = consistant_ty... | 33 | 105 | 0.710438 |
from .station import consistant_typical_range_stations
def stations_level_over_threshold(stations: list, tol: float) -> list:
stations = consistant_typical_range_stations(stations)
res_list = []
for station in stations:
rel_level = station.relative_water_level()
if rel_level is not... | true | true |
790cd20c1eb080db8972ea17344464e89aba0020 | 4,856 | py | Python | docs/source/conf.py | aditya-a-patil/FHash | 1de0b6de02ac48c77c706b50a63cb160367791da | [
"Unlicense"
] | null | null | null | docs/source/conf.py | aditya-a-patil/FHash | 1de0b6de02ac48c77c706b50a63cb160367791da | [
"Unlicense"
] | null | null | null | docs/source/conf.py | aditya-a-patil/FHash | 1de0b6de02ac48c77c706b50a63cb160367791da | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
#
# FHash documentation build configuration file, created by
# sphinx-quickstart on Fri Apr 21 20:02:16 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | 29.609756 | 79 | 0.682043 |
import sphinx_rtd_theme
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('../../'))
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.coverage']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project... | true | true |
790cd3fccecabdb2dd1cb0b0786fb112775bc3f4 | 8,093 | py | Python | src/oci/devops/models/create_deployment_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/devops/models/create_deployment_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/devops/models/create_deployment_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 35.495614 | 245 | 0.66922 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel
from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class CreateDeploymentDetails(object):
def __init__(self, **kwargs):
self.swagger_types = {
'deploy_pipelin... | true | true |
790cd474124af4aa4ad07f2cfbb6061ed2aed215 | 141 | py | Python | cogwhitelist/__init__.py | notodinair/RedV3-Cogs | 47747ccc33617dcaa3851ff12c6f95aee675d1e6 | [
"MIT"
] | 1 | 2020-06-08T13:39:30.000Z | 2020-06-08T13:39:30.000Z | cogwhitelist/__init__.py | Tominous/Swift-Cogs | 47747ccc33617dcaa3851ff12c6f95aee675d1e6 | [
"MIT"
] | null | null | null | cogwhitelist/__init__.py | Tominous/Swift-Cogs | 47747ccc33617dcaa3851ff12c6f95aee675d1e6 | [
"MIT"
] | 1 | 2020-06-08T13:39:32.000Z | 2020-06-08T13:39:32.000Z | from redbot.core.bot import Red
from cogwhitelist.cogwhitelist import CogWhitelist
def setup(bot: Red):
bot.add_cog(CogWhitelist(bot))
| 20.142857 | 50 | 0.787234 | from redbot.core.bot import Red
from cogwhitelist.cogwhitelist import CogWhitelist
def setup(bot: Red):
bot.add_cog(CogWhitelist(bot))
| true | true |
790cd47f782ec185d034063836af6adfc3e82b78 | 849 | py | Python | src/app/tests/owl/tests_owl_functional.py | denkasyanov/education-backend | c796b6f2f1cc1cd09f83cab2ca0cc45344906ef5 | [
"MIT"
] | 62 | 2021-09-22T18:38:26.000Z | 2022-03-29T06:09:42.000Z | src/app/tests/owl/tests_owl_functional.py | denkasyanov/education-backend | c796b6f2f1cc1cd09f83cab2ca0cc45344906ef5 | [
"MIT"
] | 50 | 2021-09-16T07:17:31.000Z | 2022-03-26T12:06:58.000Z | src/app/tests/owl/tests_owl_functional.py | denkasyanov/education-backend | c796b6f2f1cc1cd09f83cab2ca0cc45344906ef5 | [
"MIT"
] | 16 | 2021-10-17T17:43:31.000Z | 2022-03-26T11:22:45.000Z | import pytest
from django.core import mail
from app.mail.owl import TemplOwl # type: ignore
pytestmark = [pytest.mark.django_db]
@pytest.fixture(autouse=True)
def _enable_email(settings):
settings.EMAIL_ENABLED = True
@pytest.fixture
def owl():
return TemplOwl(
to='f@f213.in',
template_id... | 19.295455 | 80 | 0.699647 | import pytest
from django.core import mail
from app.mail.owl import TemplOwl
pytestmark = [pytest.mark.django_db]
@pytest.fixture(autouse=True)
def _enable_email(settings):
settings.EMAIL_ENABLED = True
@pytest.fixture
def owl():
return TemplOwl(
to='f@f213.in',
template_id=100500,
)... | true | true |
790cd5393642b080cb5c3a25937c16f011a6984c | 5,321 | py | Python | src/penn_chime/charts.py | nickcanz/chime | cb03218ee5cc71b92704c8be379924ac459259d7 | [
"MIT"
] | 1 | 2020-05-09T14:43:53.000Z | 2020-05-09T14:43:53.000Z | src/penn_chime/charts.py | nickcanz/chime | cb03218ee5cc71b92704c8be379924ac459259d7 | [
"MIT"
] | null | null | null | src/penn_chime/charts.py | nickcanz/chime | cb03218ee5cc71b92704c8be379924ac459259d7 | [
"MIT"
] | null | null | null |
from math import ceil
import datetime
from altair import Chart # type: ignore
import pandas as pd # type: ignore
import numpy as np
from .parameters import Parameters
from .utils import add_date_column
from .presentation import DATE_FORMAT
def new_admissions_chart(
alt, projection_admits: pd.DataFrame, param... | 29.893258 | 113 | 0.584852 |
from math import ceil
import datetime
from altair import Chart
import pandas as pd
import numpy as np
from .parameters import Parameters
from .utils import add_date_column
from .presentation import DATE_FORMAT
def new_admissions_chart(
alt, projection_admits: pd.DataFrame, parameters: Parameters
) -> Chart... | true | true |
790cd558e9b23c59ef942ba9bd925d54f00ffdf7 | 973 | py | Python | tests/test_simple.py | pooya/disco | e03a337b3b20e191459c74a367b9e89e873f71ff | [
"BSD-3-Clause"
] | 786 | 2015-01-01T12:35:40.000Z | 2022-03-19T04:39:22.000Z | tests/test_simple.py | pooya/disco | e03a337b3b20e191459c74a367b9e89e873f71ff | [
"BSD-3-Clause"
] | 51 | 2015-01-19T20:07:01.000Z | 2019-10-19T21:03:06.000Z | tests/test_simple.py | pooya/disco | e03a337b3b20e191459c74a367b9e89e873f71ff | [
"BSD-3-Clause"
] | 122 | 2015-01-05T18:16:03.000Z | 2021-07-10T12:35:22.000Z | from disco.test import TestCase, TestJob
from disco.compat import bytes_to_str
class SimpleJob(TestJob):
@staticmethod
def map(e, params):
yield int(e), (bytes_to_str(e)).strip()
@staticmethod
def reduce(iter, out, params):
for k, v in sorted(iter):
out.add(k, v)
class Sim... | 27.8 | 76 | 0.634121 | from disco.test import TestCase, TestJob
from disco.compat import bytes_to_str
class SimpleJob(TestJob):
@staticmethod
def map(e, params):
yield int(e), (bytes_to_str(e)).strip()
@staticmethod
def reduce(iter, out, params):
for k, v in sorted(iter):
out.add(k, v)
class Sim... | true | true |
790cd5f3efbb4e5b2afb556e2d0a477098397709 | 6,796 | py | Python | python/paddle/fluid/tests/unittests/test_fleet_recompute_meta_optimizer.py | OuyangChao/Paddle | cac9635a6733ffbbd816b33e21c3054e0cd81ab1 | [
"Apache-2.0"
] | 3 | 2021-06-08T14:24:36.000Z | 2021-06-08T14:24:38.000Z | python/paddle/fluid/tests/unittests/test_fleet_recompute_meta_optimizer.py | chenyanlei1/Paddle | f249a5f05f0f5832279244d88c8cb4eaaad1fbd4 | [
"Apache-2.0"
] | 1 | 2020-09-22T08:54:49.000Z | 2020-09-22T11:44:09.000Z | python/paddle/fluid/tests/unittests/test_fleet_recompute_meta_optimizer.py | chenyanlei1/Paddle | f249a5f05f0f5832279244d88c8cb4eaaad1fbd4 | [
"Apache-2.0"
] | 1 | 2021-08-04T14:28:58.000Z | 2021-08-04T14:28:58.000Z | # Copyright (c) 2020 PaddlePaddle 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 appli... | 39.283237 | 80 | 0.657004 |
import unittest
import paddle
import paddle.fluid as fluid
import os
from fleet_meta_optimizer_base import TestFleetMetaOptimizer
from paddle.distributed.fleet.meta_optimizers import RecomputeOptimizer
paddle.enable_static()
class TestFleetRecomputeMetaOptimizer(TestFleetMetaOptimizer):
def test_re... | true | true |
790cd6097aeef92cfda5f0eb2ecabaee480a01dc | 2,544 | py | Python | neural_network_lrp.py | ahijevyc/NSC_objects | 322728a71ec011b681b0038e9dcd86df1f73b2fd | [
"MIT"
] | null | null | null | neural_network_lrp.py | ahijevyc/NSC_objects | 322728a71ec011b681b0038e9dcd86df1f73b2fd | [
"MIT"
] | null | null | null | neural_network_lrp.py | ahijevyc/NSC_objects | 322728a71ec011b681b0038e9dcd86df1f73b2fd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import numpy as np
import datetime as dt
import sys, os, pickle, time
from keras.models import Model, save_model, load_model
from keras.regularizers import l2
from keras.optimizers import SGD, Adam
import keras.backend as K
import tensorflow as tf
import pandas as pd
import innvestigate
import in... | 31.8 | 157 | 0.737421 |
import numpy as np
import datetime as dt
import sys, os, pickle, time
from keras.models import Model, save_model, load_model
from keras.regularizers import l2
from keras.optimizers import SGD, Adam
import keras.backend as K
import tensorflow as tf
import pandas as pd
import innvestigate
import innvestigate.utils as i... | true | true |
790cd740173cdfadf13951914be2ab38241e3456 | 1,650 | py | Python | SensorTile/STM32CubeFunctionPack_SENSING1_V4.0.2/Middlewares/ST/STM32_AI_AudioPreprocessing_Library/Python/MFCC.py | MahendraSondagar/STMicroelectronics | 1b3cab9da8e9a23b2372573b08f6a55ea4424668 | [
"MIT"
] | null | null | null | SensorTile/STM32CubeFunctionPack_SENSING1_V4.0.2/Middlewares/ST/STM32_AI_AudioPreprocessing_Library/Python/MFCC.py | MahendraSondagar/STMicroelectronics | 1b3cab9da8e9a23b2372573b08f6a55ea4424668 | [
"MIT"
] | null | null | null | SensorTile/STM32CubeFunctionPack_SENSING1_V4.0.2/Middlewares/ST/STM32_AI_AudioPreprocessing_Library/Python/MFCC.py | MahendraSondagar/STMicroelectronics | 1b3cab9da8e9a23b2372573b08f6a55ea4424668 | [
"MIT"
] | 1 | 2021-05-19T11:35:09.000Z | 2021-05-19T11:35:09.000Z | #!/usr/bin/env python
# coding: utf-8
# This software component is licensed by ST under BSD 3-Clause license,
# the "License"; You may not use this file except in compliance with the
# License. You may obtain a copy of the License at:
# https://opensource.org/licenses/BSD-3-Clause
... | 26.190476 | 75 | 0.643636 |
import numpy as np
import librosa
import scipy
from scipy.signal import hann
from scipy.fftpack import dct
def mfcc_col(buff_test):
window = 2048
half_window = int(window / 2)
n_mels = 128
n_coeff = 13
assert buff_test.shape == (window,)
hann_asym_f32 = hann(wi... | true | true |
790cd82bd1fd5436917e52ba00b5728b6618f83e | 402 | py | Python | blog/migrations/0036_auto_20190503_1645.py | akindele214/181hub_2 | 48b8814b5f66ad87f9a54721506076ddf70fe9bc | [
"MIT"
] | 1 | 2020-05-20T08:42:49.000Z | 2020-05-20T08:42:49.000Z | blog/migrations/0036_auto_20190503_1645.py | akindele214/181hub_2 | 48b8814b5f66ad87f9a54721506076ddf70fe9bc | [
"MIT"
] | 14 | 2020-03-24T17:31:08.000Z | 2022-03-11T23:59:30.000Z | blog/migrations/0036_auto_20190503_1645.py | akindele214/181hub_2 | 48b8814b5f66ad87f9a54721506076ddf70fe9bc | [
"MIT"
] | 1 | 2020-04-13T12:37:37.000Z | 2020-04-13T12:37:37.000Z | # Generated by Django 2.1.5 on 2019-05-03 15:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0035_post_video'),
]
operations = [
migrations.AlterField(
model_name='post',
name='video',
fiel... | 21.157895 | 80 | 0.59204 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0035_post_video'),
]
operations = [
migrations.AlterField(
model_name='post',
name='video',
field=models.FileField(blank=True, null=True, uploa... | true | true |
790cd9c5dc8128e7a217f6660368342c46113ae7 | 2,829 | py | Python | jiant/tasks/lib/wnli.py | yzpang/jiant | 192d6b525c06f33010b59044df40cb86bbfba4ea | [
"MIT"
] | 1,108 | 2019-04-22T09:19:19.000Z | 2022-03-31T13:23:51.000Z | jiant/tasks/lib/wnli.py | yzpang/jiant | 192d6b525c06f33010b59044df40cb86bbfba4ea | [
"MIT"
] | 737 | 2019-04-22T14:30:36.000Z | 2022-03-31T22:22:17.000Z | jiant/tasks/lib/wnli.py | yzpang/jiant | 192d6b525c06f33010b59044df40cb86bbfba4ea | [
"MIT"
] | 273 | 2019-04-23T01:42:11.000Z | 2022-03-25T15:59:38.000Z | import numpy as np
import torch
from dataclasses import dataclass
from typing import List
from jiant.tasks.core import (
BaseExample,
BaseTokenizedExample,
BaseDataRow,
BatchMixin,
GlueMixin,
Task,
TaskTypes,
)
from jiant.tasks.lib.templates.shared import double_sentence_featurize, labels_t... | 26.688679 | 89 | 0.655002 | import numpy as np
import torch
from dataclasses import dataclass
from typing import List
from jiant.tasks.core import (
BaseExample,
BaseTokenizedExample,
BaseDataRow,
BatchMixin,
GlueMixin,
Task,
TaskTypes,
)
from jiant.tasks.lib.templates.shared import double_sentence_featurize, labels_t... | true | true |
790cda14ea0bb293e4b8bc537d023829f45b9266 | 12,231 | py | Python | step_2/scripts/sample_subjectivity_tweets.py | chuajiesheng/twitter-sentiment-analysis | 7617243c953a20c517a737c79fe0f54e55aef140 | [
"Apache-2.0"
] | null | null | null | step_2/scripts/sample_subjectivity_tweets.py | chuajiesheng/twitter-sentiment-analysis | 7617243c953a20c517a737c79fe0f54e55aef140 | [
"Apache-2.0"
] | null | null | null | step_2/scripts/sample_subjectivity_tweets.py | chuajiesheng/twitter-sentiment-analysis | 7617243c953a20c517a737c79fe0f54e55aef140 | [
"Apache-2.0"
] | null | null | null | import sys
import json
import hashlib
import gc
from operator import *
import shlex
from pyspark import StorageLevel
from pyspark.sql import SQLContext
from pyspark.sql.functions import *
from pyspark.sql.types import *
import numpy as np
from subjectivity_clues import clues
def expect(name, var, expected, op=eq):... | 39.711039 | 205 | 0.739024 | import sys
import json
import hashlib
import gc
from operator import *
import shlex
from pyspark import StorageLevel
from pyspark.sql import SQLContext
from pyspark.sql.functions import *
from pyspark.sql.types import *
import numpy as np
from subjectivity_clues import clues
def expect(name, var, expected, op=eq):... | false | true |
790cda4bf2faa9f70329ed0bb38027dd59328653 | 2,208 | py | Python | resources/lib/xbmcswift2/cli/cli.py | liberty-developer/plugin.video.metalliq-forqed | 5477783a00672c9ae315c7897617d7bba8d746fd | [
"Apache-2.0"
] | 2 | 2018-09-07T06:56:06.000Z | 2021-03-18T05:18:22.000Z | resources/lib/xbmcswift2/cli/cli.py | liberty-developer/plugin.video.metalliq-forqed | 5477783a00672c9ae315c7897617d7bba8d746fd | [
"Apache-2.0"
] | null | null | null | resources/lib/xbmcswift2/cli/cli.py | liberty-developer/plugin.video.metalliq-forqed | 5477783a00672c9ae315c7897617d7bba8d746fd | [
"Apache-2.0"
] | 2 | 2020-04-23T18:06:15.000Z | 2021-03-18T05:18:25.000Z | '''
xbmcswift2.cli.cli
------------------
The main entry point for the xbmcswift2 console script. CLI commands can be
registered in this module.
:copyright: (c) 2012 by Jonathan Beluch
:license: GPLv3, see LICENSE for more details.
'''
import sys
from optparse import OptionParser
... | 28.675325 | 80 | 0.652627 | import sys
from optparse import OptionParser
from xbmcswift2.cli.app import RunCommand
from xbmcswift2.cli.create import CreateCommand
COMMANDS = {
RunCommand.command: RunCommand,
CreateCommand.command: CreateCommand,
}
USAGE = '''%prog <command>
Commands:
create
Create a ne... | true | true |
790cdbbe1658c1b58ae557798b2a62f86ce73895 | 630 | py | Python | pincer/objects/message/reaction.py | mjneff2/Pincer | a11bc3e4bad319fdf927d913c58c933576ec7c99 | [
"MIT"
] | null | null | null | pincer/objects/message/reaction.py | mjneff2/Pincer | a11bc3e4bad319fdf927d913c58c933576ec7c99 | [
"MIT"
] | null | null | null | pincer/objects/message/reaction.py | mjneff2/Pincer | a11bc3e4bad319fdf927d913c58c933576ec7c99 | [
"MIT"
] | null | null | null | # Copyright Pincer 2021-Present
# Full MIT License can be found in `LICENSE` at the project root.
from __future__ import annotations
from dataclasses import dataclass
from typing import TYPE_CHECKING
from ...utils.api_object import APIObject
if TYPE_CHECKING:
from ..message.emoji import Emoji
@dataclass
class... | 19.6875 | 65 | 0.706349 |
from __future__ import annotations
from dataclasses import dataclass
from typing import TYPE_CHECKING
from ...utils.api_object import APIObject
if TYPE_CHECKING:
from ..message.emoji import Emoji
@dataclass
class Reaction(APIObject):
count: int
me: bool
emoji: Emoji
| true | true |
790cdc4d9b91f6b3c77afc2a43eaebd858044833 | 2,137 | py | Python | Revision/vis3d/prepare.py | qai222/ATMOxide | 42702c1ce299233569c8a3c0a9712b0e62ef6b16 | [
"MIT"
] | null | null | null | Revision/vis3d/prepare.py | qai222/ATMOxide | 42702c1ce299233569c8a3c0a9712b0e62ef6b16 | [
"MIT"
] | null | null | null | Revision/vis3d/prepare.py | qai222/ATMOxide | 42702c1ce299233569c8a3c0a9712b0e62ef6b16 | [
"MIT"
] | null | null | null | from rdkit import Chem
from AnalysisModule.routines.util import load_pkl
# logit_result = yaml_fileread("../logistic.yml")
logit_result = load_pkl("../clf3d/logistic.pkl")
"""
epg-string --> maxscore
--> [(f, s)] --> xx, yy, zz, [(x, y, d)] --> refcode, amine
"""
from rdkit.Chem import rdDepictor
from r... | 33.390625 | 203 | 0.621432 | from rdkit import Chem
from AnalysisModule.routines.util import load_pkl
logit_result = load_pkl("../clf3d/logistic.pkl")
from rdkit.Chem import rdDepictor
from rdkit.Chem.Draw import rdMolDraw2D
def moltosvg(mol, molSize=(450, 450), kekulize=True):
mc = Chem.Mol(mol.ToBinary())
if kekulize:
try:
... | true | true |
790cdc5677023f1caeda62f7c3d38c1e283ad395 | 1,256 | bzl | Python | test/extra_exec_rustc_flags/defs.bzl | silas-enf/rules_rust | 41b39f0c9951dfda3bd0a95df31695578dd3f5ea | [
"Apache-2.0"
] | 1 | 2017-06-12T02:10:48.000Z | 2017-06-12T02:10:48.000Z | test/extra_exec_rustc_flags/defs.bzl | silas-enf/rules_rust | 41b39f0c9951dfda3bd0a95df31695578dd3f5ea | [
"Apache-2.0"
] | null | null | null | test/extra_exec_rustc_flags/defs.bzl | silas-enf/rules_rust | 41b39f0c9951dfda3bd0a95df31695578dd3f5ea | [
"Apache-2.0"
] | null | null | null | """Test transitions to test extra_exec_rustc_flags."""
def _extra_exec_rustc_flags_transition_impl(_settings, attr):
return {
"//:extra_exec_rustc_flags": attr.extra_exec_rustc_flags,
}
_extra_exec_rustc_flags_transition = transition(
implementation = _extra_exec_rustc_flags_transition_impl,
i... | 27.911111 | 80 | 0.663217 |
def _extra_exec_rustc_flags_transition_impl(_settings, attr):
return {
"//:extra_exec_rustc_flags": attr.extra_exec_rustc_flags,
}
_extra_exec_rustc_flags_transition = transition(
implementation = _extra_exec_rustc_flags_transition_impl,
inputs = [],
outputs = ["//:extra_exec_rustc_flags"]... | true | true |
790cdc9973b62eeb3220bc841bae964fe6ed1651 | 6,863 | py | Python | src/tissue_purifier/models/_optim_scheduler.py | broadinstitute/tissue_purifier | 989ce9d58bba99a3f1c49743eed22dcc64e5f159 | [
"Apache-2.0"
] | null | null | null | src/tissue_purifier/models/_optim_scheduler.py | broadinstitute/tissue_purifier | 989ce9d58bba99a3f1c49743eed22dcc64e5f159 | [
"Apache-2.0"
] | null | null | null | src/tissue_purifier/models/_optim_scheduler.py | broadinstitute/tissue_purifier | 989ce9d58bba99a3f1c49743eed22dcc64e5f159 | [
"Apache-2.0"
] | null | null | null | from typing import Tuple
import math
import torch
from torch.optim.optimizer import Optimizer
def linear_warmup_and_cosine_protocol(
f_values: Tuple[float, float, float],
x_milestones: Tuple[int, int, int, int]):
"""
There are 5 regions:
1. constant at f0 for x < x0
2. linear increase ... | 38.127778 | 115 | 0.560105 | from typing import Tuple
import math
import torch
from torch.optim.optimizer import Optimizer
def linear_warmup_and_cosine_protocol(
f_values: Tuple[float, float, float],
x_milestones: Tuple[int, int, int, int]):
assert x_milestones[0] <= x_milestones[1] <= x_milestones[2] <= x_milestones[3]
... | true | true |
790cdcdc82117b3c9160fdd4b290fbace6a359f3 | 234 | py | Python | Lib/site-packages/nbconvert/tests/files/hello.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | 1 | 2021-12-14T18:49:11.000Z | 2021-12-14T18:49:11.000Z | Lib/site-packages/nbconvert/tests/files/hello.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/nbconvert/tests/files/hello.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | from nbconvert.writers.base import WriterBase
class HelloWriter(WriterBase):
def write(self, output, resources, notebook_name=None, **kw):
with open("hello.txt", "w") as outfile:
outfile.write("hello world")
| 29.25 | 65 | 0.683761 | from nbconvert.writers.base import WriterBase
class HelloWriter(WriterBase):
def write(self, output, resources, notebook_name=None, **kw):
with open("hello.txt", "w") as outfile:
outfile.write("hello world")
| true | true |
790cdd1f25475d11a3eed1a60bb988ffcfb980d5 | 1,616 | py | Python | tests/basetest.py | WolfgangFahl/pyOnlineSpreadSheetEditing | a941a6b0cd89297491d8d2b8fa3efc7a2993c132 | [
"Apache-2.0"
] | null | null | null | tests/basetest.py | WolfgangFahl/pyOnlineSpreadSheetEditing | a941a6b0cd89297491d8d2b8fa3efc7a2993c132 | [
"Apache-2.0"
] | 26 | 2021-12-11T09:01:25.000Z | 2022-03-25T09:05:19.000Z | tests/basetest.py | WolfgangFahl/pyOnlineSpreadSheetEditing | a941a6b0cd89297491d8d2b8fa3efc7a2993c132 | [
"Apache-2.0"
] | null | null | null | '''
Created on 2021-08-19
@author: wf
'''
from unittest import TestCase
import time
import getpass
import os
class BaseTest(TestCase):
'''
base test case
'''
def setUp(self,debug=False,profile=True):
'''
setUp test environment
'''
TestCase.setUp(self)
self.... | 25.25 | 70 | 0.571782 | from unittest import TestCase
import time
import getpass
import os
class BaseTest(TestCase):
def setUp(self,debug=False,profile=True):
TestCase.setUp(self)
self.debug=debug
self.profile=profile
msg=f"test {self._testMethodName}, debug={self.debug}"
self.profiler=Profile... | true | true |
790cddbbccae17b65b924bcd5b757e4998a93ad0 | 46 | py | Python | grade/tests/constants.py | ProgrammingDaisukiClub/Orientation2015Problems | ea778f830b427980690b9bf36be27851cb05c584 | [
"MIT"
] | 1 | 2017-10-05T09:26:45.000Z | 2017-10-05T09:26:45.000Z | grade/tests/constants.py | ProgrammingDaisukiClub/Orientation2015Problems | ea778f830b427980690b9bf36be27851cb05c584 | [
"MIT"
] | 1 | 2015-06-25T00:09:08.000Z | 2015-06-25T00:09:08.000Z | grade/tests/constants.py | ProgrammingDaisukiClub/Orientation2015Problems | ea778f830b427980690b9bf36be27851cb05c584 | [
"MIT"
] | 3 | 2015-06-24T13:21:30.000Z | 2020-05-15T14:04:32.000Z | #!/usr/bin/python2
MIN = -10000
MAX = 10000
| 7.666667 | 18 | 0.630435 |
MIN = -10000
MAX = 10000
| true | true |
790cddf0a9b9395c3b600894c840659887dfacc3 | 773 | py | Python | src/test/resources/simpleapp.py | shaipraj/databricks-client-java | 720f680a3c7fd8cd4174aa412f2608de1816bec3 | [
"Apache-2.0"
] | 8 | 2017-09-15T05:24:08.000Z | 2021-03-24T14:36:34.000Z | src/test/resources/simpleapp.py | shaipraj/databricks-client-java | 720f680a3c7fd8cd4174aa412f2608de1816bec3 | [
"Apache-2.0"
] | 9 | 2018-07-09T17:39:26.000Z | 2021-12-09T19:48:18.000Z | src/test/resources/simpleapp.py | shaipraj/databricks-client-java | 720f680a3c7fd8cd4174aa412f2608de1816bec3 | [
"Apache-2.0"
] | 5 | 2018-07-10T01:36:23.000Z | 2019-12-02T17:39:52.000Z | from pyspark.sql import SparkSession
def get_spark():
return (SparkSession.builder
.appName("simpleapp")
.master("local")
.getOrCreate())
from pyspark import SparkConf, SparkContext
import sys
def main(sc, args):
print("SimpleApp Arguments")
for x in args:
... | 20.891892 | 44 | 0.564036 | from pyspark.sql import SparkSession
def get_spark():
return (SparkSession.builder
.appName("simpleapp")
.master("local")
.getOrCreate())
from pyspark import SparkConf, SparkContext
import sys
def main(sc, args):
print("SimpleApp Arguments")
for x in args:
... | false | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.