hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | 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 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
769e3b1895cb160f796a75fb6b4a1f65e35082be | 4,856 | py | Python | cocpit/gui_label.py | vprzybylo/COCPIT | cce6d614e9646bdf6c74c8163ad73126c429b6fa | [
"MIT"
] | 1 | 2020-08-27T14:29:13.000Z | 2020-08-27T14:29:13.000Z | cocpit/gui_label.py | vprzybylo/COCPIT | cce6d614e9646bdf6c74c8163ad73126c429b6fa | [
"MIT"
] | 1 | 2020-08-27T15:37:51.000Z | 2020-08-27T16:56:00.000Z | cocpit/gui_label.py | vprzybylo/COCPIT | cce6d614e9646bdf6c74c8163ad73126c429b6fa | [
"MIT"
] | null | null | null | import ipywidgets
import matplotlib.pyplot as plt
from IPython.display import clear_output
from ipywidgets import Button
from PIL import Image
from shutil import copyfile
import os
from typing import Union, List
import cocpit.config as config
import pandas as pd
class GUI:
"""
View and label images in noteboo... | 33.958042 | 160 | 0.563221 |
7341208d0b8bfb7cf35ecb157108b066f2a410eb | 172 | py | Python | assignments/assignment2/solutions/Nkarnaud/devhub-0.1.0/src/pages/views.py | Nkarnaud/python-mentorship | a00735fc8b63e244b91575540c54d0eea942381f | [
"Apache-2.0"
] | 1 | 2019-04-22T18:42:51.000Z | 2019-04-22T18:42:51.000Z | assignments/assignment2/solutions/Nkarnaud/devhub-0.1.0/src/pages/views.py | Nkarnaud/python-mentorship | a00735fc8b63e244b91575540c54d0eea942381f | [
"Apache-2.0"
] | null | null | null | assignments/assignment2/solutions/Nkarnaud/devhub-0.1.0/src/pages/views.py | Nkarnaud/python-mentorship | a00735fc8b63e244b91575540c54d0eea942381f | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render
from django.views.generic import TemplateView
# Create your views here.
class HomeView(TemplateView):
template_name = 'home.html'
| 21.5 | 45 | 0.790698 |
633a14bf79fed579adce7a9fb68be2ba5f975102 | 800 | py | Python | tests/conftest.py | jayvdb/sls | c788815898b3665cfe5b316b7780190cb9bdacb9 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | jayvdb/sls | c788815898b3665cfe5b316b7780190cb9bdacb9 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | jayvdb/sls | c788815898b3665cfe5b316b7780190cb9bdacb9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from pytest import fixture
@fixture
def magic(mocker):
"""
Shorthand for mocker.MagicMock. It's magic!
"""
return mocker.MagicMock
@fixture
def patch_init(mocker):
"""
Makes patching a class' constructor slightly easier
"""
def patch_init(item):
mocker... | 20.512821 | 64 | 0.6725 |
ac74a2e60f408a48b28baf2cf66f2d6714fa778b | 428 | py | Python | manage.py | Isaac-waithaka/News-highlights | 54b3b9cbee3be809962638970508acd7ae094ef8 | [
"MIT"
] | null | null | null | manage.py | Isaac-waithaka/News-highlights | 54b3b9cbee3be809962638970508acd7ae094ef8 | [
"MIT"
] | null | null | null | manage.py | Isaac-waithaka/News-highlights | 54b3b9cbee3be809962638970508acd7ae094ef8 | [
"MIT"
] | null | null | null | from app import create_app
from flask_script import Manager, Server
# Creating app instance
app = create_app('development')
manager = Manager(app)
manager.add_command('server', Server)
# @manager.command
# def test():
# """Run unit tests."""
# import unittest
# tests = unittest.TestLoader().discover('te... | 20.380952 | 53 | 0.698598 |
1a03f5a6bda98de413cef1ab22ccbaabd11d4389 | 19,836 | py | Python | lib/galaxy/tool_util/deps/__init__.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 4 | 2015-05-12T20:36:41.000Z | 2017-06-26T15:34:02.000Z | lib/galaxy/tool_util/deps/__init__.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 52 | 2015-03-16T14:02:14.000Z | 2021-12-24T09:50:23.000Z | lib/galaxy/tool_util/deps/__init__.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 1 | 2016-03-21T12:54:06.000Z | 2016-03-21T12:54:06.000Z | """
Dependency management for tools.
"""
import json
import logging
import os.path
import shutil
from collections import OrderedDict
from galaxy.util import (
hash_util,
plugin_config,
string_as_bool,
)
from galaxy.util.oset import OrderedSet
from .container_resolvers import ContainerResolver
from .depend... | 45.495413 | 168 | 0.678514 |
b61cbfddf966b6d193713dd454b5648cee2703a8 | 1,452 | py | Python | defaults.py | ecreager/vibntf | e4081cdc37b61e75cc7aa53809d489cd3b5cdd7f | [
"Apache-2.0"
] | 2 | 2019-11-17T15:35:26.000Z | 2022-01-26T16:47:50.000Z | defaults.py | ecreager/vibntf | e4081cdc37b61e75cc7aa53809d489cd3b5cdd7f | [
"Apache-2.0"
] | null | null | null | defaults.py | ecreager/vibntf | e4081cdc37b61e75cc7aa53809d489cd3b5cdd7f | [
"Apache-2.0"
] | 1 | 2019-12-17T06:19:01.000Z | 2019-12-17T06:19:01.000Z | import numpy
__author__ = 'ecreager'
# stft
N = 1024
HOP = N//4
# ddm
Q = 2
L = 5
R = 50
# ntf
S = 2
Z = 3
EM_ITER = 100
# synth
FS = 44100 # music
SIG_DUR = 2.0 # seconds
F0 = 220.
RATE = 10.
DEPTH = F0/20.
PHASE_INIT = -numpy.pi/2 # phase of a cosine; theta = -pi/2 -> f(theta) = 0 and rising
FM_PHASE_INIT = -nu... | 28.470588 | 107 | 0.717631 |
0691e104a21e10791068f477a50ff0ec7cf25087 | 1,096 | py | Python | opencga-app/build/analysis/hpg-variant/bin/hpg-var-gwas.py | roalva1/opencga | 26f6fc6615d7039c9116d86171deb38bcfa7b480 | [
"Apache-2.0"
] | null | null | null | opencga-app/build/analysis/hpg-variant/bin/hpg-var-gwas.py | roalva1/opencga | 26f6fc6615d7039c9116d86171deb38bcfa7b480 | [
"Apache-2.0"
] | 2 | 2021-01-21T01:32:01.000Z | 2021-06-04T02:49:23.000Z | opencga-app/build/analysis/hpg-variant/bin/hpg-var-gwas.py | roalva1/opencga | 26f6fc6615d7039c9116d86171deb38bcfa7b480 | [
"Apache-2.0"
] | 1 | 2020-07-03T13:19:41.000Z | 2020-07-03T13:19:41.000Z | #!/usr/bin/python
import sys, os, argparse, commands, time
def execute(cmd):
status, output = commands.getstatusoutput(cmd)
if status != 0:
print("EXIT ERROR")
print(str(status) + " -> " + output + " - " + cmd)
sys.exit(1)
a = sys.argv
a.append("--out")
a.append("output.test")
del a[0]
orig = " ".... | 22.367347 | 183 | 0.673358 |
83bab2160572c4f05db65aff72d5ba457ecafc2d | 2,720 | py | Python | ci-scripts/infra-setup/roles/rrcockpit/files/grafana/import-grafana.py | amolkahat/ci-config | 100ca1248432ba8d1a97a9a02ec35a80f57767ed | [
"Apache-2.0"
] | null | null | null | ci-scripts/infra-setup/roles/rrcockpit/files/grafana/import-grafana.py | amolkahat/ci-config | 100ca1248432ba8d1a97a9a02ec35a80f57767ed | [
"Apache-2.0"
] | null | null | null | ci-scripts/infra-setup/roles/rrcockpit/files/grafana/import-grafana.py | amolkahat/ci-config | 100ca1248432ba8d1a97a9a02ec35a80f57767ed | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import argparse
import requests
import json
import glob
def import_file(host, key, path, json_file_path):
authorization_header = "Bearer {}".format(key)
headers = {
'Authorization': authorization_header,
'Accept': 'application/json',
'Conent-Type': 'application/j... | 37.260274 | 79 | 0.586765 |
85901af11415f7cc521ff6a6dcc88ac718adae52 | 479 | py | Python | superset/migrations/versions/ca69c70ec99b_tracking_url.py | sssswangzi/superset | 3ff53b20bbe8ecc80d7dd3bf91d5d7af7c6c43cb | [
"Apache-2.0"
] | 18 | 2018-11-21T16:38:55.000Z | 2020-11-26T07:38:24.000Z | superset/migrations/versions/ca69c70ec99b_tracking_url.py | 7nRyan/incubator-superset | 5616d7bdd72cb6d41caaf8733823d5d7dbe26abb | [
"Apache-2.0"
] | 16 | 2019-12-30T04:58:10.000Z | 2022-03-08T23:41:14.000Z | superset/migrations/versions/ca69c70ec99b_tracking_url.py | 7nRyan/incubator-superset | 5616d7bdd72cb6d41caaf8733823d5d7dbe26abb | [
"Apache-2.0"
] | 16 | 2018-09-25T08:16:52.000Z | 2020-11-11T05:12:17.000Z | # -*- coding: utf-8 -*-
"""tracking_url
Revision ID: ca69c70ec99b
Revises: a65458420354
Create Date: 2017-07-26 20:09:52.606416
"""
# revision identifiers, used by Alembic.
revision = 'ca69c70ec99b'
down_revision = 'a65458420354'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
... | 19.16 | 79 | 0.728601 |
7576bd6c84747ddb701338cafeaef2cdcc9cb149 | 797 | py | Python | molecool/io/pdb.py | chaszg/molecool | 183f793480b037a14ff7c5b5ea466478efc8f216 | [
"BSD-3-Clause"
] | null | null | null | molecool/io/pdb.py | chaszg/molecool | 183f793480b037a14ff7c5b5ea466478efc8f216 | [
"BSD-3-Clause"
] | null | null | null | molecool/io/pdb.py | chaszg/molecool | 183f793480b037a14ff7c5b5ea466478efc8f216 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
def open_pdb(file_location):
"""
This function reads in a pdb file and returns the atom names and coordinates.
Parameters
----------
file_location : str
The path to the pdb file.
Returns
-------
symbols : list
Symbols of all atoms in pdb.
coo... | 25.709677 | 81 | 0.583438 |
3568f26fd32f431545253151232db152be021cba | 61 | py | Python | 10/02/5/string/module.py | pylangstudy/201706 | f1cc6af6b18e5bd393cda27f5166067c4645d4d3 | [
"CC0-1.0"
] | null | null | null | 10/02/5/string/module.py | pylangstudy/201706 | f1cc6af6b18e5bd393cda27f5166067c4645d4d3 | [
"CC0-1.0"
] | 70 | 2017-06-01T11:02:51.000Z | 2017-06-30T00:35:32.000Z | 10/02/5/string/module.py | pylangstudy/201706 | f1cc6af6b18e5bd393cda27f5166067c4645d4d3 | [
"CC0-1.0"
] | null | null | null | def some_method():
print('pakage1.module.some_method()')
| 20.333333 | 41 | 0.704918 |
ffad5e373355a720ba7295e97a7ba8726b47b169 | 1,314 | py | Python | model/elasticsearch.py | zkdev/cc-utils | 042c6632ca6f61a484bc0a71f85957aeba7f7278 | [
"BSD-3-Clause"
] | 15 | 2018-04-18T13:25:30.000Z | 2022-03-04T09:25:41.000Z | model/elasticsearch.py | zkdev/cc-utils | 042c6632ca6f61a484bc0a71f85957aeba7f7278 | [
"BSD-3-Clause"
] | 221 | 2018-04-12T06:29:43.000Z | 2022-03-27T03:01:40.000Z | model/elasticsearch.py | zkdev/cc-utils | 042c6632ca6f61a484bc0a71f85957aeba7f7278 | [
"BSD-3-Clause"
] | 29 | 2018-04-11T14:42:23.000Z | 2021-11-09T16:26:32.000Z | # Copyright (c) 2019-2020 SAP SE or an SAP affiliate company. All rights reserved. This file is
# licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... | 31.285714 | 96 | 0.733638 |
18d2ba5d4713ff0d48c01a8a443a30c9dfdf969e | 1,175 | py | Python | setup.py | Xiangyongluo/exceltosqlserver | 03888122564ae3e1dcb40cf6859c0abbe41dc09b | [
"MIT"
] | 2 | 2021-03-29T08:49:58.000Z | 2022-01-27T01:21:26.000Z | setup.py | Xiangyongluo/exceltosqlserver | 03888122564ae3e1dcb40cf6859c0abbe41dc09b | [
"MIT"
] | 1 | 2021-01-04T16:45:35.000Z | 2022-01-27T01:21:50.000Z | setup.py | Xiangyongluo/exceltosqlserver | 03888122564ae3e1dcb40cf6859c0abbe41dc09b | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
try:
# if have requirements.txt file inside the folder
with open("requirements.txt", "r", encoding="utf-8") as f:
modules_needed = [i.strip() for i in fh.readlines()]
except:
modules_need... | 29.375 | 103 | 0.640851 |
109099260fab9b06f17ceefc08dc662869b2985d | 1,480 | py | Python | user_test.py | Muia23/Pass-Locker | 8e15a27478fa98c96044437892e50476b77256a2 | [
"Unlicense"
] | null | null | null | user_test.py | Muia23/Pass-Locker | 8e15a27478fa98c96044437892e50476b77256a2 | [
"Unlicense"
] | null | null | null | user_test.py | Muia23/Pass-Locker | 8e15a27478fa98c96044437892e50476b77256a2 | [
"Unlicense"
] | null | null | null | import unittest
from user import User
class TestUser(unittest.TestCase):
'''
Defines test cases for the user class behaviours.
'''
def setUp(self):
'''
Method runs before each test.
'''
self.new_user = User("Wilfred", "wil1234")
def tearDown(self):
... | 20.273973 | 58 | 0.572973 |
94c927b3393b7d259eb551b8345d15b6fabbc7a1 | 103 | py | Python | Project Euler Exercises/factorial_r.py | oreillyh/Python-problems | 5284d2b0b57a9e9c05c10214f1105e159a392950 | [
"Apache-2.0"
] | null | null | null | Project Euler Exercises/factorial_r.py | oreillyh/Python-problems | 5284d2b0b57a9e9c05c10214f1105e159a392950 | [
"Apache-2.0"
] | null | null | null | Project Euler Exercises/factorial_r.py | oreillyh/Python-problems | 5284d2b0b57a9e9c05c10214f1105e159a392950 | [
"Apache-2.0"
] | null | null | null | def factorial(n):
if (n == 0):
return 1
return n * factorial(n-1);
print(factorial(5)) | 17.166667 | 30 | 0.553398 |
431c50500fc246353f0487219bd0b31f50ed0e52 | 2,186 | py | Python | vspk/v6/fetchers/nudscpremarkingpolicies_fetcher.py | axxyhtrx/vspk-python | 4495882c6bcbb1ef51b14b9f4dc7efe46476ff50 | [
"BSD-3-Clause"
] | 19 | 2016-03-07T12:34:22.000Z | 2020-06-11T11:09:02.000Z | vspk/v6/fetchers/nudscpremarkingpolicies_fetcher.py | axxyhtrx/vspk-python | 4495882c6bcbb1ef51b14b9f4dc7efe46476ff50 | [
"BSD-3-Clause"
] | 40 | 2016-06-13T15:36:54.000Z | 2020-11-10T18:14:43.000Z | vspk/v6/fetchers/nudscpremarkingpolicies_fetcher.py | axxyhtrx/vspk-python | 4495882c6bcbb1ef51b14b9f4dc7efe46476ff50 | [
"BSD-3-Clause"
] | 15 | 2016-06-10T22:06:01.000Z | 2020-12-15T18:37:42.000Z | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrigh... | 41.245283 | 86 | 0.735133 |
7fca9983c4ee2edbf90b3be0de8a317057062c6b | 39 | py | Python | file_strategies/__init__.py | CarbonLighthouse/file-strategies | bfd4ae69d51da18ae67d4f7c5ecbe3ed3ca70421 | [
"MIT"
] | 1 | 2018-09-06T21:29:34.000Z | 2018-09-06T21:29:34.000Z | file_strategies/__init__.py | CarbonLighthouse/file-strategies | bfd4ae69d51da18ae67d4f7c5ecbe3ed3ca70421 | [
"MIT"
] | 3 | 2018-02-28T22:26:19.000Z | 2018-04-23T20:14:57.000Z | file_strategies/__init__.py | CarbonLighthouse/file-strategies | bfd4ae69d51da18ae67d4f7c5ecbe3ed3ca70421 | [
"MIT"
] | null | null | null | from .file_strategies import make_file
| 19.5 | 38 | 0.871795 |
e95b9b5ead0bfaba82b4ba8048b72d203ed04339 | 2,069 | py | Python | examples/learning_models/example_sequence_cpu_phenotyping.py | pyvonpyton/PyHealth | b7eb39ed18a335dc702bfdb0801fe7f2d9ca5366 | [
"BSD-2-Clause"
] | null | null | null | examples/learning_models/example_sequence_cpu_phenotyping.py | pyvonpyton/PyHealth | b7eb39ed18a335dc702bfdb0801fe7f2d9ca5366 | [
"BSD-2-Clause"
] | null | null | null | examples/learning_models/example_sequence_cpu_phenotyping.py | pyvonpyton/PyHealth | b7eb39ed18a335dc702bfdb0801fe7f2d9ca5366 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Example of using GRU on MIMIC demo mortality prediction
"""
# License: BSD 2 clause
# environment setting
import os
import sys
sys.path.append(
os.path.abspath(os.path.join(os.path.dirname("__file__"), '..')))
root_dir = os.path.abspath(os.path.join(__file__, "../../.."))
os.chdir(root... | 33.918033 | 77 | 0.733204 |
7d4891bbaa82ff16d3dee1e462b93d69dd3a15e1 | 611 | py | Python | solutions/lesson3_frog_jmp.py | ardenn/codility | 45f8d5ae7de92cfde60a3f3f5ebee2a233273bd4 | [
"MIT"
] | null | null | null | solutions/lesson3_frog_jmp.py | ardenn/codility | 45f8d5ae7de92cfde60a3f3f5ebee2a233273bd4 | [
"MIT"
] | null | null | null | solutions/lesson3_frog_jmp.py | ardenn/codility | 45f8d5ae7de92cfde60a3f3f5ebee2a233273bd4 | [
"MIT"
] | null | null | null | def solution(X, Y, D):
"""
A function that, given three integers X, Y and D, returns the minimal number of jumps of length D from position X to a position equal to or greater than Y.
For example, given:
X = 10
Y = 85
D = 30
the function should return 3, because the frog will be positioned as... | 40.733333 | 159 | 0.653028 |
f0ebb676a3a6fc0845fc190fd55f557363adad51 | 18,855 | py | Python | DFP/multi_experience_memory.py | ryangoy/RDRL | 06862db742a9d4a8b95c487cd1b457e375994b05 | [
"MIT"
] | null | null | null | DFP/multi_experience_memory.py | ryangoy/RDRL | 06862db742a9d4a8b95c487cd1b457e375994b05 | [
"MIT"
] | null | null | null | DFP/multi_experience_memory.py | ryangoy/RDRL | 06862db742a9d4a8b95c487cd1b457e375994b05 | [
"MIT"
] | null | null | null | '''
Class for experience replay with multiple actors
'''
from __future__ import print_function
import numpy as np
import random
import matplotlib.pyplot as plt
import matplotlib
from matplotlib import gridspec
matplotlib.use('Agg')
import time
import os
from . import util as my_util
class MultiExperienceMemory:
... | 50.28 | 184 | 0.602281 |
5d77d744c9f8393dee424f7376acd580c438480f | 12,683 | py | Python | opt_einsum/tests/test_sharing.py | kianmeng/opt_einsum | 81330efe55b77a10509cd4684df1afcb86940660 | [
"MIT"
] | 570 | 2015-01-03T02:56:26.000Z | 2022-03-29T00:52:50.000Z | opt_einsum/tests/test_sharing.py | kianmeng/opt_einsum | 81330efe55b77a10509cd4684df1afcb86940660 | [
"MIT"
] | 180 | 2015-05-13T05:50:09.000Z | 2022-03-20T22:01:29.000Z | opt_einsum/tests/test_sharing.py | kianmeng/opt_einsum | 81330efe55b77a10509cd4684df1afcb86940660 | [
"MIT"
] | 57 | 2015-01-03T04:08:03.000Z | 2022-02-13T07:27:13.000Z | import itertools
import weakref
from collections import Counter
import numpy as np
import pytest
from opt_einsum import contract, contract_expression, contract_path, get_symbol, helpers, shared_intermediates
from opt_einsum.backends import to_cupy, to_torch
from opt_einsum.contract import _einsum
from opt_einsum.pars... | 33.46438 | 117 | 0.626508 |
8aae16b491a346722bb7f77728d89a674425c633 | 4,108 | py | Python | airflow/providers/microsoft/azure/hooks/azure_container_volume.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 15,947 | 2019-01-05T13:51:02.000Z | 2022-03-31T23:33:16.000Z | airflow/providers/microsoft/azure/hooks/azure_container_volume.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 14,603 | 2019-01-05T09:43:19.000Z | 2022-03-31T23:11:59.000Z | airflow/providers/microsoft/azure/hooks/azure_container_volume.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 8,429 | 2019-01-05T19:45:47.000Z | 2022-03-31T22:13:01.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... | 38.392523 | 107 | 0.64557 |
ccc4f2029609f2e59bdfba219070aaeb23b141f7 | 569 | py | Python | hood/migrations/0009_auto_20190916_1301.py | Juliet-jay/neighborhood | fa7dfacf77c54ffb75136778e68cda344a3bb543 | [
"Unlicense",
"MIT"
] | null | null | null | hood/migrations/0009_auto_20190916_1301.py | Juliet-jay/neighborhood | fa7dfacf77c54ffb75136778e68cda344a3bb543 | [
"Unlicense",
"MIT"
] | 5 | 2020-06-05T23:03:19.000Z | 2021-09-08T01:17:23.000Z | hood/migrations/0009_auto_20190916_1301.py | Juliet-jay/neighborhood | fa7dfacf77c54ffb75136778e68cda344a3bb543 | [
"Unlicense",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-09-16 10:01
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('hood', '0008_auto_20190916_1256'),
]
operations =... | 25.863636 | 129 | 0.659051 |
98666ee73621a5d3588900811bb9123394267457 | 2,909 | py | Python | doc/source/sphinxext/breathe/finder/core.py | dettmann/bolero | fa88be1a1d4ab1e2855d20f5429ac83ed5eb4925 | [
"BSD-3-Clause"
] | 55 | 2018-12-01T02:42:01.000Z | 2022-03-25T22:06:25.000Z | docs/ext/breathe/finder/core.py | MissingBitStudios/kyte | ca31ef851360ae7fbfaffb85e49c3897b96a9357 | [
"CC-BY-4.0"
] | 94 | 2017-05-19T19:44:07.000Z | 2021-12-15T13:40:59.000Z | docs/ext/breathe/finder/core.py | MissingBitStudios/kyte | ca31ef851360ae7fbfaffb85e49c3897b96a9357 | [
"CC-BY-4.0"
] | 31 | 2017-05-19T19:41:39.000Z | 2021-08-25T14:14:19.000Z |
from . import index as indexfinder
from . import compound as compoundfinder
class CreateCompoundTypeSubFinder(object):
def __init__(self, parser_factory, matcher_factory):
self.parser_factory = parser_factory
self.matcher_factory = matcher_factory
def __call__(self, project_info, *args):
... | 29.989691 | 94 | 0.714679 |
5a76da71859efff4941955e309ec6b0a731c4979 | 1,456 | py | Python | iotscp/core/mpsc.py | TylerZeroMaster/iotscp | e25233913b2d3486acc9d38bed47713a5d0ab708 | [
"MIT"
] | null | null | null | iotscp/core/mpsc.py | TylerZeroMaster/iotscp | e25233913b2d3486acc9d38bed47713a5d0ab708 | [
"MIT"
] | null | null | null | iotscp/core/mpsc.py | TylerZeroMaster/iotscp | e25233913b2d3486acc9d38bed47713a5d0ab708 | [
"MIT"
] | null | null | null | from threading import Condition
from collections import deque
from time import sleep
class Channel():
"""This class is a multi-producer, single-consumer FIFO queue, providing
message-based blocking communcations over channels
"""
def __init__(self):
self.cond = Condition()
self.queue =... | 30.978723 | 78 | 0.609203 |
abeea8738b4f468d2af6d9bb3e1b65b856b60ebf | 21,209 | py | Python | google/cloud/aiplatform_v1beta1/services/job_service/transports/base.py | TheMichaelHu/python-aiplatform | e03f373a7e44c354eda88875a41c771f6d7e3ce1 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1beta1/services/job_service/transports/base.py | TheMichaelHu/python-aiplatform | e03f373a7e44c354eda88875a41c771f6d7e3ce1 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1beta1/services/job_service/transports/base.py | TheMichaelHu/python-aiplatform | e03f373a7e44c354eda88875a41c771f6d7e3ce1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 35.172471 | 101 | 0.647414 |
db494a54b5350fe1d2902c5254840f17595d4f46 | 204 | py | Python | BotTesting/cogs/ExampleCogs.py | TimmyTradeMark/TimmyBot | 7a9c364233b82c3f0581063c348376308c70d74b | [
"MIT"
] | 2 | 2020-10-25T04:35:21.000Z | 2020-10-25T19:44:08.000Z | BotTesting/cogs/ExampleCogs.py | TimmyTradeMark/TimmyBot | 7a9c364233b82c3f0581063c348376308c70d74b | [
"MIT"
] | 3 | 2020-10-25T04:26:01.000Z | 2020-10-27T17:19:23.000Z | BotTesting/cogs/ExampleCogs.py | TimmyTradeMark/TimmyBot | 7a9c364233b82c3f0581063c348376308c70d74b | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
class Example(commands.Cog):
def __init__(self, client):
self.client = client
def setup(client):
client.add_cog(Example(client)) | 20.4 | 35 | 0.691176 |
e503031e10bfccd1276eaceaaa4b3cadbe5ac051 | 37,250 | py | Python | sockeye/model_pt.py | blchu/sockeye | 28044a44ee409c9b3df1711c0b16bdebdd463b2e | [
"Apache-2.0"
] | null | null | null | sockeye/model_pt.py | blchu/sockeye | 28044a44ee409c9b3df1711c0b16bdebdd463b2e | [
"Apache-2.0"
] | null | null | null | sockeye/model_pt.py | blchu/sockeye | 28044a44ee409c9b3df1711c0b16bdebdd463b2e | [
"Apache-2.0"
] | null | null | null | # Copyright 2017--2021 Amazon.com, Inc. or its affiliates. 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. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fi... | 48.376623 | 119 | 0.650094 |
7eb8db3144f9bd79837d41e251c3a6eb077540f1 | 7,482 | py | Python | c++/examples/paraview_plotter.py | ryanlopezzzz/ABPTutorial | 923fa89f1959cd71b28ecf4628ecfbfce6a6206c | [
"MIT"
] | 8 | 2020-05-05T00:41:50.000Z | 2021-11-04T20:54:43.000Z | c++/examples/paraview_plotter.py | ryanlopezzzz/ABPTutorial | 923fa89f1959cd71b28ecf4628ecfbfce6a6206c | [
"MIT"
] | null | null | null | c++/examples/paraview_plotter.py | ryanlopezzzz/ABPTutorial | 923fa89f1959cd71b28ecf4628ecfbfce6a6206c | [
"MIT"
] | 5 | 2020-05-04T16:37:13.000Z | 2021-08-18T07:53:58.000Z | # state file generated using paraview version 5.8.0
# ----------------------------------------------------------------
# setup views used in the visualization
# ----------------------------------------------------------------
# trace generated using paraview version 5.8.0
#
# To ensure correct image size when batch p... | 42.033708 | 120 | 0.708901 |
d53f90c8bc3702d36e6cac4d7b198a9cea6037a6 | 1,394 | py | Python | 2-Roofline-acquiring/scripts/drawRoofLine.py | intellistream/PC-AMP | 8525c72048b880f58f2f612a7c00b342f7105386 | [
"Apache-2.0"
] | null | null | null | 2-Roofline-acquiring/scripts/drawRoofLine.py | intellistream/PC-AMP | 8525c72048b880f58f2f612a7c00b342f7105386 | [
"Apache-2.0"
] | null | null | null | 2-Roofline-acquiring/scripts/drawRoofLine.py | intellistream/PC-AMP | 8525c72048b880f58f2f612a7c00b342f7105386 | [
"Apache-2.0"
] | null | null | null | #! python3
import csv
import numpy as np
import matplotlib.pyplot as plt
import groupLine as groupLine
def drawRoofLineFromCSV(a,title,fname):
print(a)
with open(a, 'r') as f:
reader = csv.reader(f)
#reader = [each for each in csv.DictReader(f, delimiter=',')]
result = list(reader)
... | 27.88 | 85 | 0.535151 |
47fd0c506f1efab3ea182ba2055a3eafe0dfc39c | 5,107 | py | Python | src/linear_regression_using_gradient_descent.py | phani1995/linear_regression | 670f6f6ce493965a9c070092fcce9a6b6b7b8e5d | [
"MIT"
] | 2 | 2018-12-17T01:15:47.000Z | 2018-12-17T01:17:32.000Z | src/linear_regression_using_gradient_descent.py | phani1995/linear_regression | 670f6f6ce493965a9c070092fcce9a6b6b7b8e5d | [
"MIT"
] | null | null | null | src/linear_regression_using_gradient_descent.py | phani1995/linear_regression | 670f6f6ce493965a9c070092fcce9a6b6b7b8e5d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#-------------------------------------- DATA PREPROCESSING ---------------------------------#
# Imports
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import math
from matplotlib.animation import FuncAnimation
# Reading the dataset from data
dataset = pd.read_csv(r'..... | 29.350575 | 163 | 0.658704 |
2300776192b1df1baa82d1a25304c0b90393a9cf | 981 | py | Python | src/FieldOperations/gradDivVectorFieldListGolden2Inst.cc.py | jmikeowen/Spheral | 3e1082a7aefd6b328bd3ae24ca1a477108cfc3c4 | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | 22 | 2018-07-31T21:38:22.000Z | 2020-06-29T08:58:33.000Z | src/FieldOperations/gradDivVectorFieldListGolden2Inst.cc.py | jmikeowen/Spheral | 3e1082a7aefd6b328bd3ae24ca1a477108cfc3c4 | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | 41 | 2020-09-28T23:14:27.000Z | 2022-03-28T17:01:33.000Z | src/FieldOperations/gradDivVectorFieldListGolden2Inst.cc.py | jmikeowen/Spheral | 3e1082a7aefd6b328bd3ae24ca1a477108cfc3c4 | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | 7 | 2019-12-01T07:00:06.000Z | 2020-09-15T21:12:39.000Z | text = """
//------------------------------------------------------------------------------
// Explicit instantiation.
//------------------------------------------------------------------------------
#include "FieldOperations/gradDivVectorFieldListGolden2.cc"
#include "Geometry/Dimension.hh"
namespace Spheral {
//===... | 40.875 | 87 | 0.519878 |
23f3f51fa420fe03928cd5dcc493a346064702fe | 5,712 | py | Python | snapshot_creation.py | arcapix/gpfsapi-examples | 15bff7fda7b0a576209253dee48eb44e4c0d565f | [
"MIT"
] | 10 | 2016-05-17T12:58:35.000Z | 2022-01-10T05:23:45.000Z | snapshot_creation.py | arcapix/gpfsapi-examples | 15bff7fda7b0a576209253dee48eb44e4c0d565f | [
"MIT"
] | null | null | null | snapshot_creation.py | arcapix/gpfsapi-examples | 15bff7fda7b0a576209253dee48eb44e4c0d565f | [
"MIT"
] | 1 | 2016-09-12T09:07:00.000Z | 2016-09-12T09:07:00.000Z | #!/opt/arcapix/bin/python2.7
# -*- coding: utf-8 -*-
# Copyright 2015 ArcaPix Limited
# All Rights Reserved.
#
# Licensed under the ArcaPix API License, Version 1.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://... | 33.017341 | 124 | 0.667367 |
267745053c295ebc40b962fd7b244c075431de39 | 8,268 | py | Python | responsibly/fairness/metrics/score.py | staeiou/responsibly | f476796ef574750de30f6216c906a16eb7416106 | [
"MIT"
] | 48 | 2019-11-18T02:48:48.000Z | 2021-12-04T14:51:54.000Z | responsibly/fairness/metrics/score.py | staeiou/responsibly | f476796ef574750de30f6216c906a16eb7416106 | [
"MIT"
] | 19 | 2018-09-01T01:03:21.000Z | 2019-07-17T08:19:29.000Z | responsibly/fairness/metrics/score.py | staeiou/responsibly | f476796ef574750de30f6216c906a16eb7416106 | [
"MIT"
] | 6 | 2020-04-24T21:34:37.000Z | 2021-10-19T23:45:31.000Z | from collections import Counter
from functools import partial
import numpy as np
import pandas as pd
from sklearn.metrics import roc_auc_score, roc_curve
from sklearn.utils.multiclass import unique_labels
from responsibly.fairness.metrics.utils import (
_assert_binary, _groupby_y_x_sens,
)
def _proportion(data,... | 35.333333 | 125 | 0.597968 |
135fc3fa49aabab8e9ab9a1521b99067eb08f300 | 12,412 | py | Python | pyro/ops/gaussian.py | dennisprangle/pyro | decaf9eac6ba513efba01c8380a3a34faec4cd05 | [
"MIT"
] | 10 | 2020-03-18T14:41:25.000Z | 2021-07-04T08:49:57.000Z | pyro/ops/gaussian.py | dennisprangle/pyro | decaf9eac6ba513efba01c8380a3a34faec4cd05 | [
"MIT"
] | 19 | 2018-10-30T13:45:31.000Z | 2019-09-27T14:16:57.000Z | pyro/ops/gaussian.py | dennisprangle/pyro | decaf9eac6ba513efba01c8380a3a34faec4cd05 | [
"MIT"
] | 5 | 2020-06-21T23:40:35.000Z | 2021-11-09T16:18:42.000Z | import math
import torch
from torch.distributions.utils import lazy_property
from torch.nn.functional import pad
from pyro.distributions.util import broadcast_shape
class Gaussian(object):
"""
Non-normalized Gaussian distribution.
This represents an arbitrary semidefinite quadratic function, which can ... | 39.403175 | 113 | 0.605543 |
5504d671a58620c0c4baf57e4458302a864c0ae2 | 14,419 | py | Python | tensorboard/backend/event_processing/event_file_inspector.py | davidsoergel/tensorboard | 2f6d8dc93ca83484f8f6473ab008ea43202b3a46 | [
"Apache-2.0"
] | 16 | 2018-10-13T14:38:34.000Z | 2021-11-25T13:54:29.000Z | tensorboard/backend/event_processing/event_file_inspector.py | davidsoergel/tensorboard | 2f6d8dc93ca83484f8f6473ab008ea43202b3a46 | [
"Apache-2.0"
] | 4 | 2020-12-04T21:00:38.000Z | 2022-01-22T12:49:30.000Z | tensorboard/backend/event_processing/event_file_inspector.py | davidsoergel/tensorboard | 2f6d8dc93ca83484f8f6473ab008ea43202b3a46 | [
"Apache-2.0"
] | 2 | 2020-11-25T11:33:33.000Z | 2021-02-17T15:18:50.000Z | # Copyright 2015 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... | 34.495215 | 80 | 0.688189 |
e0c38d7aec7914299e3c628ba928933f652e1e84 | 3,643 | py | Python | src/api_trt/modules/utils/fast_face_align.py | u0251077/InsightFace-REST | 40a35c2057359e78b018b0c2aef339867439a6c4 | [
"Apache-2.0"
] | null | null | null | src/api_trt/modules/utils/fast_face_align.py | u0251077/InsightFace-REST | 40a35c2057359e78b018b0c2aef339867439a6c4 | [
"Apache-2.0"
] | null | null | null | src/api_trt/modules/utils/fast_face_align.py | u0251077/InsightFace-REST | 40a35c2057359e78b018b0c2aef339867439a6c4 | [
"Apache-2.0"
] | null | null | null | # Based on https://github.com/deepinsight/insightface/tree/master/python-package/insightface/utils/face_align.py
# Improvements:
# - Removed SciPy dependency
# - Removed parts of code not used for ArcFace alignment
# - Added Numba NJIT to speed up computations
# - Added batch processing support
import cv2
import numpy... | 26.021429 | 112 | 0.60829 |
e2774c60a343c03b172017ac4781b09434bed8f6 | 3,153 | py | Python | check_miflora.py | c-kr/check_miflora | 0ecaa5b3326c4f59978ff551f1c6a461f31c4916 | [
"MIT"
] | 1 | 2020-07-22T02:27:36.000Z | 2020-07-22T02:27:36.000Z | check_miflora.py | c-kr/check_miflora | 0ecaa5b3326c4f59978ff551f1c6a461f31c4916 | [
"MIT"
] | null | null | null | check_miflora.py | c-kr/check_miflora | 0ecaa5b3326c4f59978ff551f1c6a461f31c4916 | [
"MIT"
] | 1 | 2019-12-10T13:47:31.000Z | 2019-12-10T13:47:31.000Z | #!/usr/bin/env python3
import argparse
import logging
import nagiosplugin
import re
import sys
import time
from btlewrap.gatttool import GatttoolBackend
from miflora.miflora_poller import MiFloraPoller, \
MI_CONDUCTIVITY, MI_MOISTURE, MI_LIGHT, MI_TEMPERATURE, MI_BATTERY
_log = logging.getLogger('nagiosplugin')... | 38.925926 | 120 | 0.669838 |
5fc1b13f362c595699eb9d90a62836fa799449a0 | 66 | py | Python | pandas2neo4j/__init__.py | wiatrak2/pandas2neo4j | 5436f60403511fcceb2bc5619209897b81195c5c | [
"Apache-2.0"
] | 1 | 2021-09-07T08:10:59.000Z | 2021-09-07T08:10:59.000Z | pandas2neo4j/__init__.py | wiatrak2/pandas2neo4j | 5436f60403511fcceb2bc5619209897b81195c5c | [
"Apache-2.0"
] | null | null | null | pandas2neo4j/__init__.py | wiatrak2/pandas2neo4j | 5436f60403511fcceb2bc5619209897b81195c5c | [
"Apache-2.0"
] | null | null | null | from .pandas_graph import PandasGraph
from .pandas_model import *
| 22 | 37 | 0.833333 |
50a27003f8325487c705eb44fd0a79b1af300fb0 | 21,070 | py | Python | lib/util.py | johanssonlc/electrum-zec | 0513e17e85f48bb94253cb75ea2cd28d6b61e6df | [
"MIT"
] | 9 | 2018-03-06T15:51:26.000Z | 2019-04-04T06:04:04.000Z | lib/util.py | zcash-community/electrum-zec | 0513e17e85f48bb94253cb75ea2cd28d6b61e6df | [
"MIT"
] | 5 | 2018-03-06T22:05:19.000Z | 2019-01-30T09:13:16.000Z | lib/util.py | johanssonlc/electrum-zec | 0513e17e85f48bb94253cb75ea2cd28d6b61e6df | [
"MIT"
] | 1 | 2019-06-27T23:57:55.000Z | 2019-06-27T23:57:55.000Z | # Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# 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 t... | 30.272989 | 127 | 0.618605 |
2dea866d4d673174d6910d41b28d62da0a669c03 | 4,061 | py | Python | Finance/common/iterated_prediction_loop.py | eth-sri/probabilistic-forecasts-attacks | df78ffd7375089bb7b38fbf55bb840b7699365eb | [
"Apache-2.0"
] | 24 | 2020-03-08T12:21:28.000Z | 2022-03-18T10:02:41.000Z | Finance/common/iterated_prediction_loop.py | eth-sri/probabilistic-forecasts-attacks | df78ffd7375089bb7b38fbf55bb840b7699365eb | [
"Apache-2.0"
] | 5 | 2021-06-02T01:08:55.000Z | 2021-07-26T16:21:35.000Z | Finance/common/iterated_prediction_loop.py | eth-sri/probabilistic-forecasts-attacks | df78ffd7375089bb7b38fbf55bb840b7699365eb | [
"Apache-2.0"
] | 9 | 2020-03-23T21:58:25.000Z | 2022-01-21T07:48:26.000Z | """
Copyright 2020 The Secure, Reliable, and Intelligent Systems Lab, ETH Zurich
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 appl... | 31.48062 | 87 | 0.637281 |
4ddf781e51613f77b1900ac8b83a33edc13ca771 | 1,064 | py | Python | tensorbay/utility/__init__.py | edsn60/tensorbay-python-sdk | abc428549490023dfe6ae06eab818a3e5bb97c18 | [
"MIT"
] | null | null | null | tensorbay/utility/__init__.py | edsn60/tensorbay-python-sdk | abc428549490023dfe6ae06eab818a3e5bb97c18 | [
"MIT"
] | null | null | null | tensorbay/utility/__init__.py | edsn60/tensorbay-python-sdk | abc428549490023dfe6ae06eab818a3e5bb97c18 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2021 Graviti. Licensed under MIT License.
#
"""Utility classes."""
from .attr import AttrsMixin, attr, attr_base, camel, upper
from .common import (
DefaultValueDeprecated,
Deprecated,
Disable,
EqMixin,
KwargsDeprecated,
MatrixType,
common_loads,
lo... | 20.461538 | 84 | 0.665414 |
84d2b045c25d8c98785113e217aa38a555aa8bb6 | 4,133 | py | Python | server/src/main/Server.py | james199644/SmartRoom | 8bb5e83e56f18c5fdc83a65f2d4dc5992faf766d | [
"MIT"
] | null | null | null | server/src/main/Server.py | james199644/SmartRoom | 8bb5e83e56f18c5fdc83a65f2d4dc5992faf766d | [
"MIT"
] | null | null | null | server/src/main/Server.py | james199644/SmartRoom | 8bb5e83e56f18c5fdc83a65f2d4dc5992faf766d | [
"MIT"
] | null | null | null | import paho.mqtt.client as mqtt
from pprint import pprint
import os,sys,inspect
script_dir = os.path.dirname(__file__)
sys.path.insert(0, script_dir)
from SmartRoomClient import SmartRoomClient
import json
import logging
from threading import Thread
import time
log = logging.getLogger("MQTT_LOG_DEBUG")
GETSTATUS = "GE... | 30.389706 | 94 | 0.632954 |
e1561cb68e2219c6beecd104e6f862b926ec3c60 | 1,986 | py | Python | examples/parse_user_input.py | jkalish14/UserInputParser | 55a3f40ed684038813e9de3dd07ee367b28fbf69 | [
"MIT"
] | 3 | 2022-01-21T22:08:50.000Z | 2022-01-22T15:27:42.000Z | examples/parse_user_input.py | jkalish14/UserInputParser | 55a3f40ed684038813e9de3dd07ee367b28fbf69 | [
"MIT"
] | null | null | null | examples/parse_user_input.py | jkalish14/UserInputParser | 55a3f40ed684038813e9de3dd07ee367b28fbf69 | [
"MIT"
] | null | null | null | import warnings
from inputparser import *
import json
from inputparser import InputParser
def custom_constraint(val, str_starts_with: str):
returnValue = True
if len(val) < len(str_starts_with):
returnValue = False
elif val[0:len(str_starts_with)] == str_starts_with:
returnValue = True
... | 38.941176 | 117 | 0.579557 |
37c49b172012c5aedd1936d2dfee3fbc1b3b38ae | 922 | py | Python | Semana_5/ejemplos_if_2.py | federicobl/ProgramacionEAN20191 | 4ed2288617f84218eab279d70d40764b8c0d6eab | [
"MIT"
] | null | null | null | Semana_5/ejemplos_if_2.py | federicobl/ProgramacionEAN20191 | 4ed2288617f84218eab279d70d40764b8c0d6eab | [
"MIT"
] | null | null | null | Semana_5/ejemplos_if_2.py | federicobl/ProgramacionEAN20191 | 4ed2288617f84218eab279d70d40764b8c0d6eab | [
"MIT"
] | null | null | null | def mensaje_negativo(numero):
"""
(float) -> str
Escribe un mensaje para evaluar un numero negativo
>>> mensaje_negativo(-10.0)
'El numero es negativo'
>>> mensaje_negativo(898)
'El numero es positivo'
:param numero: num el numero a evaluar
:return: str con el mensaje de la evaluació... | 29.741935 | 54 | 0.642082 |
d89017807d6541b6ea6c8cd80e72e128e7588e16 | 5,725 | py | Python | xTool/setup.py | luciferliu/xTools | 324ef1388be13ece0d952e3929eb685212d573f1 | [
"Apache-2.0"
] | null | null | null | xTool/setup.py | luciferliu/xTools | 324ef1388be13ece0d952e3929eb685212d573f1 | [
"Apache-2.0"
] | null | null | null | xTool/setup.py | luciferliu/xTools | 324ef1388be13ece0d952e3929eb685212d573f1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import platform
import sys
import warnings
import codecs
import re
from distutils.errors import CCompilerError
from distutils.errors import DistutilsExecError
from distutils.errors import DistutilsPlatformError
from setuptools.command.test import test as TestCommand
extension_support... | 29.817708 | 79 | 0.664454 |
888feff12f35d3453f2e42060f6a64c77734f58e | 405 | py | Python | backend/chester1_29281/wsgi.py | crowdbotics-apps/chester1-29281 | 1f610a1d51314393e8e83d15168599cd55f3a8f4 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/chester1_29281/wsgi.py | crowdbotics-apps/chester1-29281 | 1f610a1d51314393e8e83d15168599cd55f3a8f4 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/chester1_29281/wsgi.py | crowdbotics-apps/chester1-29281 | 1f610a1d51314393e8e83d15168599cd55f3a8f4 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for chester1_29281 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANG... | 23.823529 | 78 | 0.792593 |
f9d3bc83e40bc2a5795458b7441a9a523d3c2fda | 9,198 | py | Python | openmdao/core/tests/test_system.py | hwangjt/blue | 609defbe476c86a4a2eddd12977b47e649ea7f50 | [
"Apache-2.0"
] | null | null | null | openmdao/core/tests/test_system.py | hwangjt/blue | 609defbe476c86a4a2eddd12977b47e649ea7f50 | [
"Apache-2.0"
] | null | null | null | openmdao/core/tests/test_system.py | hwangjt/blue | 609defbe476c86a4a2eddd12977b47e649ea7f50 | [
"Apache-2.0"
] | null | null | null | """ Unit tests for the system interface."""
import unittest
from six import assertRaisesRegex
import warnings
import numpy as np
from openmdao.api import Problem, Group, IndepVarComp, ExecComp
from openmdao.devtools.testutil import assert_rel_error
class TestSystem(unittest.TestCase):
def test_vector_context... | 34.973384 | 86 | 0.579583 |
073af2643146bf336f1f6b3637f0968c57cfb3e7 | 1,358 | py | Python | modron/interact/tests/conftest.py | WardLT/play-by-post-helper | 26df681f2a28510f88e552be628910e4e5fe57bb | [
"MIT"
] | null | null | null | modron/interact/tests/conftest.py | WardLT/play-by-post-helper | 26df681f2a28510f88e552be628910e4e5fe57bb | [
"MIT"
] | 13 | 2020-04-08T02:56:58.000Z | 2020-10-04T21:52:43.000Z | modron/interact/tests/conftest.py | WardLT/play-by-post-helper | 26df681f2a28510f88e552be628910e4e5fe57bb | [
"MIT"
] | null | null | null | from typing import Dict
import os
from pytest import fixture
from modron.slack import BotClient
from modron.interact.npc import NPCGenerator
from modron.interact.reminder import ReminderModule
from modron.interact.dice_roll import DiceRollInteraction
from modron.interact.character import CharacterSheet
from modron.in... | 30.863636 | 100 | 0.738586 |
166aae73bb783927a9dbd761068e15a97533b98a | 23,746 | py | Python | Tests/test_seq.py | barendt/biopython | 391bcdbee7f821bff3e12b75c635a06bc1b2dcea | [
"PostgreSQL"
] | 1 | 2016-05-09T13:17:59.000Z | 2016-05-09T13:17:59.000Z | Tests/test_seq.py | cymon/biopython-github-master | 7be9697599296401b0a7126d23b5eda391a94116 | [
"PostgreSQL"
] | null | null | null | Tests/test_seq.py | cymon/biopython-github-master | 7be9697599296401b0a7126d23b5eda391a94116 | [
"PostgreSQL"
] | null | null | null | # This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
from Bio import Seq
from Bio.Alphabet import IUPAC
from Bio import Alphabet
from Bio.Data.IUPACData import ambiguous_dna_complement, ambiguous_rna_comp... | 38.11557 | 121 | 0.598753 |
772a9ef03849ed9a314838c7aad097591bd2495b | 3,294 | py | Python | tests/test_buffer.py | pelotoncycle/dd-trace-py | b5254016dc42185eebfadce8dc634003408439d7 | [
"BSD-3-Clause"
] | null | null | null | tests/test_buffer.py | pelotoncycle/dd-trace-py | b5254016dc42185eebfadce8dc634003408439d7 | [
"BSD-3-Clause"
] | null | null | null | tests/test_buffer.py | pelotoncycle/dd-trace-py | b5254016dc42185eebfadce8dc634003408439d7 | [
"BSD-3-Clause"
] | 2 | 2017-05-27T05:58:36.000Z | 2019-02-07T13:38:53.000Z | import random
import threading
from unittest import TestCase
from nose.tools import eq_, ok_
from ddtrace.span import Span
from ddtrace.writer import Q
from ddtrace.buffer import ThreadLocalSpanBuffer
class TestLocalBuffer(TestCase):
"""
Tests related to the thread local buffer
"""
def test_thread_l... | 30.5 | 76 | 0.615968 |
dd7ed5f7984b794471fa3aeefef49e405102d1d4 | 2,884 | py | Python | WeatherSelector.py | yangtengleo/carla-dataset-runner | 0deb58b07bd03a84c3de6eb5934ff78401bac156 | [
"MIT"
] | null | null | null | WeatherSelector.py | yangtengleo/carla-dataset-runner | 0deb58b07bd03a84c3de6eb5934ff78401bac156 | [
"MIT"
] | null | null | null | WeatherSelector.py | yangtengleo/carla-dataset-runner | 0deb58b07bd03a84c3de6eb5934ff78401bac156 | [
"MIT"
] | null | null | null | """
Defines a few custom weather presets. Up until version 0.9.6, carla has a few native ones; however, on my data capture
setup they don't seem to differ that much one from another
"""
import sys
import os
import settings
sys.path.append(settings.CARLA_EGG_PATH)
import carla
# https://carla.readthedocs.io/en/latest/p... | 38.972973 | 118 | 0.67129 |
20f53f9e2a71e1d001f92c8c14ee17a597388813 | 2,445 | py | Python | test/test_builtins.py | kodo-pp/katescript | 986bfb968b3a476aaf3579e4e3a25e62be6f8159 | [
"CC0-1.0"
] | 2 | 2019-12-24T12:20:28.000Z | 2019-12-25T14:46:19.000Z | test/test_builtins.py | kodo-pp/katescript | 986bfb968b3a476aaf3579e4e3a25e62be6f8159 | [
"CC0-1.0"
] | null | null | null | test/test_builtins.py | kodo-pp/katescript | 986bfb968b3a476aaf3579e4e3a25e62be6f8159 | [
"CC0-1.0"
] | null | null | null | from kates.runner import *
import pytest
def test_id():
a = ''
def set_value(runner, args):
del runner
assert len(args) == 1
nonlocal a
a = args[0]
functions = {'set': set_value}
script_ok = Script([
Assignment('x', PlainCommand('id', [LiteralArgument('Test'... | 29.817073 | 94 | 0.625358 |
29eea9dfd47ac0a6041a1cb4c1f73b7154fa0c0f | 712 | py | Python | var/spack/repos/builtin/packages/jansi-native/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/jansi-native/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/jansi-native/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class JansiNative(MavenPackage):
"""Jansi is a small ASl 2.0 licensed Java library that allows y... | 35.6 | 93 | 0.735955 |
68559dc8f52225138bacfca1f9f35cd59243f846 | 64 | py | Python | src/views/__init__.py | elmagnificogi/sapic | 8831b205bc5cf8a659dc9a3e9bdee6b6fc1dad3c | [
"BSD-3-Clause"
] | 115 | 2019-12-30T11:56:37.000Z | 2021-01-16T11:29:43.000Z | src/views/__init__.py | elmagnificogi/sapic | 8831b205bc5cf8a659dc9a3e9bdee6b6fc1dad3c | [
"BSD-3-Clause"
] | 8 | 2020-01-02T15:29:47.000Z | 2020-07-22T02:37:10.000Z | src/views/__init__.py | elmagnificogi/sapic | 8831b205bc5cf8a659dc9a3e9bdee6b6fc1dad3c | [
"BSD-3-Clause"
] | 28 | 2020-01-07T06:46:25.000Z | 2020-11-20T08:49:46.000Z | from .front import bp as front_bp
from .api import bp as api_bp
| 21.333333 | 33 | 0.78125 |
e7ff063994a2ddd12440ac48d59e6bc5f4a232f3 | 3,034 | py | Python | pyscreenshot/tempdir27.py | jonringer/pyscreenshot | 44cefded198b26fd162ab12c9e947704ec9dced0 | [
"BSD-2-Clause"
] | null | null | null | pyscreenshot/tempdir27.py | jonringer/pyscreenshot | 44cefded198b26fd162ab12c9e947704ec9dced0 | [
"BSD-2-Clause"
] | null | null | null | pyscreenshot/tempdir27.py | jonringer/pyscreenshot | 44cefded198b26fd162ab12c9e947704ec9dced0 | [
"BSD-2-Clause"
] | 1 | 2020-11-04T08:32:26.000Z | 2020-11-04T08:32:26.000Z | from __future__ import print_function
import os as _os
import tempfile
import warnings as _warnings
# https://stackoverflow.com/questions/19296146/tempfile-temporarydirectory-context-manager-in-python-2-7
class TemporaryDirectory27(object):
"""Create and return a temporary directory. This has the same
beha... | 33.340659 | 104 | 0.592617 |
52a17b63962f37a69eb0127db6a1e5a4aea6a78b | 562 | py | Python | src/origin/bus/messages/delegates.py | Energinet-DataHub/po-platform-utils | 36cf0f8a7dcd4a57119ec11bae6233f0c8760a24 | [
"Apache-2.0"
] | null | null | null | src/origin/bus/messages/delegates.py | Energinet-DataHub/po-platform-utils | 36cf0f8a7dcd4a57119ec11bae6233f0c8760a24 | [
"Apache-2.0"
] | 3 | 2022-02-28T08:55:38.000Z | 2022-03-09T12:07:04.000Z | src/origin/bus/messages/delegates.py | Energinet-DataHub/po-platform-utils | 36cf0f8a7dcd4a57119ec11bae6233f0c8760a24 | [
"Apache-2.0"
] | 2 | 2021-12-18T16:18:43.000Z | 2022-03-01T12:03:34.000Z | from dataclasses import dataclass
from origin.bus import Message
from origin.models.delegates import MeteringPointDelegate
@dataclass
class MeteringPointDelegateGranted(Message):
"""
An actor has been delegated access to a MeteringPoint.
An actor is identified by its subject
"""
delegate: Meter... | 20.814815 | 69 | 0.756228 |
d713bb90e575eca600297c93cfe4cb6dd73065ec | 386 | py | Python | Codechef/GCDMOD.py | GarvTambi/Hacktoberfest | 92b237b89698a3520b3455fda5d2f05b763b4f57 | [
"MIT"
] | 1 | 2019-12-11T12:41:53.000Z | 2019-12-11T12:41:53.000Z | Codechef/GCDMOD.py | GarvTambi/Hacktoberfest | 92b237b89698a3520b3455fda5d2f05b763b4f57 | [
"MIT"
] | null | null | null | Codechef/GCDMOD.py | GarvTambi/Hacktoberfest | 92b237b89698a3520b3455fda5d2f05b763b4f57 | [
"MIT"
] | null | null | null | def gcd(a,b):
if(b==0):
return a
return gcd(b,a%b)
t=input();
for i in range(t):
a,b,n=map(int,raw_input().split())
if(a==b):
res=pow(a,n,1000000007)
res=res+pow(b,n,1000000007)
res=res%(1000000007)
print res
continue
res=pow(a,n,a-b)
... | 21.444444 | 39 | 0.494819 |
31c3f843cf2d76d721b92d98230d6cbbdd935a31 | 17,025 | py | Python | respy/method_of_simulated_moments.py | restudToolbox/respy | 19b9602c6f34f39034b00a88f36219ed3c4cfe5a | [
"MIT"
] | 58 | 2018-04-10T19:52:43.000Z | 2022-02-28T19:45:06.000Z | respy/method_of_simulated_moments.py | restudToolbox/respy | 19b9602c6f34f39034b00a88f36219ed3c4cfe5a | [
"MIT"
] | 319 | 2018-03-29T07:06:47.000Z | 2021-09-27T18:03:10.000Z | respy/method_of_simulated_moments.py | restudToolbox/respy | 19b9602c6f34f39034b00a88f36219ed3c4cfe5a | [
"MIT"
] | 39 | 2018-04-02T09:38:02.000Z | 2021-12-30T01:13:05.000Z | """Estimate models with the method of simulated moments (MSM).
The method of simulated moments is developed by [1]_, [2]_, and [3]_ and an estimation
technique where the distance between the moments of the actual data and the moments
implied by the model parameters is minimized.
References
----------
.. [1] McFadden,... | 35.321577 | 88 | 0.689515 |
af9bb19bed0256d2f7b551d1d35f1bb139c2074e | 5,769 | py | Python | tests/training_config_test.py | mkardas/allennlp-models | c645f78e63800d5366b95e4b06d913042f498a8b | [
"Apache-2.0"
] | null | null | null | tests/training_config_test.py | mkardas/allennlp-models | c645f78e63800d5366b95e4b06d913042f498a8b | [
"Apache-2.0"
] | 18 | 2021-05-19T13:07:38.000Z | 2022-03-28T13:12:00.000Z | tests/training_config_test.py | mkardas/allennlp-models | c645f78e63800d5366b95e4b06d913042f498a8b | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
from glob import glob
import os
from typing import Dict, Tuple
import pytest
from tests import FIXTURES_ROOT
from allennlp.commands.train import TrainModel
from allennlp.common.testing import AllenNlpTestCase
from allennlp.common.params import Params
from allennlp.common.plugins import import... | 37.461039 | 120 | 0.646559 |
7b560b6376307fab29639b451a3bdcf305aeb547 | 39,004 | py | Python | outputC.py | philchang/nrpytutorial | a69d90777b2519192e3c53a129fe42827224faa3 | [
"BSD-2-Clause"
] | null | null | null | outputC.py | philchang/nrpytutorial | a69d90777b2519192e3c53a129fe42827224faa3 | [
"BSD-2-Clause"
] | null | null | null | outputC.py | philchang/nrpytutorial | a69d90777b2519192e3c53a129fe42827224faa3 | [
"BSD-2-Clause"
] | null | null | null | # As documented in the NRPy+ tutorial module
# Tutorial-Coutput__Parameter_Interface.ipynb
# this core NRPy+ module is used for
# generating C code and functions.
# Authors: Zachariah B. Etienne; zachetie **at** gmail **dot* com
# Ken Sible; ksible **at** outlook **dot* com
# Step 0.a: Define __all__, ... | 51.119266 | 251 | 0.599785 |
a5eb83049373fa90e1b5151e4a5c19577bd461e2 | 5,046 | py | Python | xcfp/parser.py | gnutrino/xcfp | 54d5840d4dc4b7f5f9d304028f82e30f648cca3a | [
"MIT"
] | 3 | 2018-05-04T04:36:27.000Z | 2021-04-10T06:04:27.000Z | xcfp/parser.py | gnutrino/xcfp | 54d5840d4dc4b7f5f9d304028f82e30f648cca3a | [
"MIT"
] | null | null | null | xcfp/parser.py | gnutrino/xcfp | 54d5840d4dc4b7f5f9d304028f82e30f648cca3a | [
"MIT"
] | 3 | 2016-05-07T00:38:35.000Z | 2019-01-16T17:25:08.000Z | #/usr/bin/python3
import struct
import io
from .properties import PropertyType, Property
class XCFParseError(Exception):
pass
class Parser():
"""Class that does all the actual work of parsing a character file,
implements the ContextManager interface to take control of the actual file
and ensure it is ... | 30.957055 | 123 | 0.589576 |
e7970717b21c58fa44ec14cf2c1a47f7e7bc2458 | 6,648 | py | Python | remote.py | notme1560/sbpe | fe87f0e34805b8c8b27577a0d6d819e3b8f96d63 | [
"ISC"
] | null | null | null | remote.py | notme1560/sbpe | fe87f0e34805b8c8b27577a0d6d819e3b8f96d63 | [
"ISC"
] | null | null | null | remote.py | notme1560/sbpe | fe87f0e34805b8c8b27577a0d6d819e3b8f96d63 | [
"ISC"
] | null | null | null | import configparser
import importlib
import json
import logging
import os
import platform
import sys
import time
from _remote import ffi, lib
util = None
VERSION = 'v1.7.0'
LOGFILE = 'remote.log'
CONFIGFILE = 'config.ini'
# non-function imported symbol types
SYMTYPES = {
'stage': 'struct Stage **',
'window_... | 27.8159 | 78 | 0.635529 |
9a20e2007c998eaac6cd535ca1f748a35d683401 | 1,968 | py | Python | envirobme280onx76.py | kflmiami420/Adafruit_CircuitPython_BME280 | 8b788b76d13c07a9c04a7e1886ec0e8be0617e69 | [
"MIT"
] | null | null | null | envirobme280onx76.py | kflmiami420/Adafruit_CircuitPython_BME280 | 8b788b76d13c07a9c04a7e1886ec0e8be0617e69 | [
"MIT"
] | null | null | null | envirobme280onx76.py | kflmiami420/Adafruit_CircuitPython_BME280 | 8b788b76d13c07a9c04a7e1886ec0e8be0617e69 | [
"MIT"
] | null | null | null | # this script will up load your gy-bme280 temp/press/humidi/alti to adafruit io
# you must create feeds with names temperature2,pressure2,humidity2,altitude2
#once the feeds are created you can create your own dash to display those readings
import time
import board
import busio
import adafruit_bme280
from Adafrui... | 36.444444 | 82 | 0.735772 |
21357c03f12b1644c710efd22c931edef742341f | 976 | py | Python | backend/movieRaterApi/api/models.py | ndenisj/movie-rating-project | a085a98b95d4cde1e2a00f47f2db13a132240144 | [
"MIT"
] | 1 | 2020-04-11T04:23:06.000Z | 2020-04-11T04:23:06.000Z | backend/movieRaterApi/api/models.py | ndenisj/movie-rating-project | a085a98b95d4cde1e2a00f47f2db13a132240144 | [
"MIT"
] | 11 | 2020-02-12T03:16:23.000Z | 2022-02-26T21:41:31.000Z | backend/movieRaterApi/api/models.py | ndenisj/movie-rating-project | a085a98b95d4cde1e2a00f47f2db13a132240144 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from django.core.validators import MaxValueValidator, MinValueValidator
class Movie(models.Model):
title = models.CharField(max_length=32)
description = models.TextField()
def no_of_rating(self):
ratings = Rating.objects.filt... | 30.5 | 88 | 0.661885 |
d7fcaf13bfba1a86161232bc781b63003948152b | 9,793 | py | Python | jc/parsers/stat.py | jon-rd/jc | 1e18dd30a824b0463f0cad86e0da7094c47d34f9 | [
"MIT"
] | null | null | null | jc/parsers/stat.py | jon-rd/jc | 1e18dd30a824b0463f0cad86e0da7094c47d34f9 | [
"MIT"
] | null | null | null | jc/parsers/stat.py | jon-rd/jc | 1e18dd30a824b0463f0cad86e0da7094c47d34f9 | [
"MIT"
] | null | null | null | """jc - JSON CLI output utility `stat` command output parser
Usage (cli):
$ stat * | jc --stat
or
$ jc stat *
Usage (module):
import jc.parsers.stat
result = jc.parsers.stat.parse(stat_command_output)
Compatibility:
'linux', 'darwin', 'freebsd'
Examples:
$ stat /bin/* | jc --stat -... | 30.413043 | 119 | 0.452772 |
4f8d26b5362c84214512d0be46dc47cde892ab6d | 9,066 | py | Python | py4we/fortran_file.py | gtpedrosa/Python4WindEnergy | f8ad09018420cfb3a419173f97b129de7118d814 | [
"Apache-2.0"
] | 48 | 2015-01-19T18:21:10.000Z | 2021-11-27T22:41:06.000Z | py4we/fortran_file.py | arash7444/Python4WindEnergy | 8f97a5f86e81ce01d80dafb6f8104165fd3ad397 | [
"Apache-2.0"
] | 1 | 2016-05-24T06:07:07.000Z | 2016-05-24T08:26:29.000Z | py4we/fortran_file.py | arash7444/Python4WindEnergy | 8f97a5f86e81ce01d80dafb6f8104165fd3ad397 | [
"Apache-2.0"
] | 24 | 2015-06-26T14:44:07.000Z | 2021-06-07T18:36:52.000Z | # Copyright 2008, 2009 Neil Martinsen-Burrell
#
# 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, modify, merge, pub... | 34.471483 | 82 | 0.595301 |
4e6cce0ef721ec1e484a5a146cbeb91e702ccdd6 | 1,360 | py | Python | src/metecho/plot/generalized_matched_filter.py | danielk333/metecho | 9df2e542e5e5d1a76cc793c6874bc41de26eb51f | [
"MIT"
] | null | null | null | src/metecho/plot/generalized_matched_filter.py | danielk333/metecho | 9df2e542e5e5d1a76cc793c6874bc41de26eb51f | [
"MIT"
] | null | null | null | src/metecho/plot/generalized_matched_filter.py | danielk333/metecho | 9df2e542e5e5d1a76cc793c6874bc41de26eb51f | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import h5py
import logging
import numpy as np
import sys
import copy
from .general import basic_matplotlib_kw
logger = logging.getLogger(__name__)
@basic_matplotlib_kw(subplot_shape=(3, 1))
def gmf(axes,
filter_output,
axis_font_size=15,
title_font_size=11,
... | 24.727273 | 67 | 0.645588 |
f4a5826a6bd2dd67959de9433f023e64108993ef | 15,209 | py | Python | tests/pubsub/test_floodsub.py | ngetahun/py-libp2p | 57077cd3b4289e2317af0bbfd91a77a110a44e38 | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/pubsub/test_floodsub.py | ngetahun/py-libp2p | 57077cd3b4289e2317af0bbfd91a77a110a44e38 | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/pubsub/test_floodsub.py | ngetahun/py-libp2p | 57077cd3b4289e2317af0bbfd91a77a110a44e38 | [
"Apache-2.0",
"MIT"
] | null | null | null | import asyncio
import multiaddr
import pytest
from tests.utils import cleanup
from libp2p import new_node
from libp2p.peer.peerinfo import info_from_p2p_addr
from libp2p.pubsub.pubsub import Pubsub
from libp2p.pubsub.floodsub import FloodSub
from libp2p.pubsub.message import MessageTalk
from libp2p.pubsub.message impo... | 31.229979 | 117 | 0.547636 |
3f6c7ba7ef9c1f2a2aafceaf3bd64339558f6543 | 1,868 | py | Python | kafka_client_decorators/client/consumer_builder.py | cdsedson/kafka-decorator | f2c958df88c5698148aae4c5314dd39e31e995c3 | [
"MIT"
] | null | null | null | kafka_client_decorators/client/consumer_builder.py | cdsedson/kafka-decorator | f2c958df88c5698148aae4c5314dd39e31e995c3 | [
"MIT"
] | null | null | null | kafka_client_decorators/client/consumer_builder.py | cdsedson/kafka-decorator | f2c958df88c5698148aae4c5314dd39e31e995c3 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""Define ConsumerBuilder class."""
from .consumer_job import ConsumerJob
class ConsumerBuilder:
"""Work as a factory to create a topic consumer."""
def __init__(self, topic, balanced, args, kargs, function):
"""Create a ConsumerBuilder object.
Pa... | 28.738462 | 67 | 0.552998 |
987e15a4becba56e43c8bd823bf453b13012dd54 | 839 | py | Python | discovery.py | kaustubhhiware/swift | 7089c4e05fd831b864de46ee37b681a6249909e3 | [
"MIT"
] | null | null | null | discovery.py | kaustubhhiware/swift | 7089c4e05fd831b864de46ee37b681a6249909e3 | [
"MIT"
] | null | null | null | discovery.py | kaustubhhiware/swift | 7089c4e05fd831b864de46ee37b681a6249909e3 | [
"MIT"
] | null | null | null | import sys
import threading
from utils import constants
from utils import misc
from discovery.threadeddiscoveryserver import ThreadedDiscoveryServer
if __name__ == "__main__":
misc.print_welcome_prompt(discovery=True)
server = None
try:
discovery_host = ''
discovery_port = constants.DISCOVE... | 29.964286 | 69 | 0.663886 |
426634f9c50660c0224a49845a432721020ab29b | 557 | py | Python | stubs/micropython-v1_14-esp32/ujson.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | stubs/micropython-v1_14-esp32/ujson.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | stubs/micropython-v1_14-esp32/ujson.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | """
Module: 'ujson' on micropython-v1.14-esp32
"""
# MCU: {'ver': 'v1.14', 'port': 'esp32', 'arch': 'xtensawin', 'sysname': 'esp32', 'release': '1.14.0', 'name': 'micropython', 'mpy': 10757, 'version': '1.14.0', 'machine': 'ESP32 module (spiram) with ESP32', 'build': '', 'nodename': 'esp32', 'platform': 'esp32', 'famil... | 24.217391 | 287 | 0.563734 |
7db48e243125f1e66ee6039fb1e64f0e537489d0 | 7,621 | py | Python | basis_testing/api.py | apltools/basis_testing | 23a903bcfd5c60cd07c854d696587fd269b237a8 | [
"CC-BY-4.0"
] | null | null | null | basis_testing/api.py | apltools/basis_testing | 23a903bcfd5c60cd07c854d696587fd269b237a8 | [
"CC-BY-4.0"
] | null | null | null | basis_testing/api.py | apltools/basis_testing | 23a903bcfd5c60cd07c854d696587fd269b237a8 | [
"CC-BY-4.0"
] | null | null | null | """
File: api.py
Namespace: basis_testing
Date: 26 April 2020
Defines functions usable in templates.
"""
import numpy
import random
import itertools
import pkg_resources
BACKLOG = []
VARIABLES = {}
ALIASES = {}
BAD_WORDS = {}
def __load_bad_words():
"""
Function __load_bad_words
L... | 27.813869 | 125 | 0.63863 |
5f3a4348d09e0eb54d3a796413997be744425f06 | 344 | py | Python | ip_generator/test_probe.py | dawsonjon/verilog-math | 0572f8a00e0bfc7c510e17fe8582259707ce0de9 | [
"MIT"
] | 52 | 2017-04-03T21:09:18.000Z | 2022-03-27T02:24:28.000Z | ip_generator/test_probe.py | mfkiwl/verilog-math | bb972582adb7f794e5d1821f5f07877fdfee6b98 | [
"MIT"
] | 8 | 2017-04-04T08:48:15.000Z | 2021-03-11T16:27:42.000Z | ip_generator/test_probe.py | mfkiwl/verilog-math | bb972582adb7f794e5d1821f5f07877fdfee6b98 | [
"MIT"
] | 18 | 2017-07-07T07:53:49.000Z | 2022-02-25T13:14:38.000Z | from .pipeliner import *
probes = []
sn = 0
def test_probe(pipe, label):
global sn, probes
print("probe", pipe, label)
probes.append(label + str(sn))
Output(label + str(sn), pipe)
sn += 1
def trace(response, n):
global probes
for i in probes:
if i in response:
print(... | 17.2 | 41 | 0.575581 |
8ad877ecf1ce1cc386e00def1566a7fb3e2c1d2a | 2,262 | py | Python | helpers/Response_helper.py | singhpreet89/Wufoo_api | b8d8ae9a6ff69a1ea07746ac0c137442bf544d01 | [
"MIT"
] | null | null | null | helpers/Response_helper.py | singhpreet89/Wufoo_api | b8d8ae9a6ff69a1ea07746ac0c137442bf544d01 | [
"MIT"
] | null | null | null | helpers/Response_helper.py | singhpreet89/Wufoo_api | b8d8ae9a6ff69a1ea07746ac0c137442bf544d01 | [
"MIT"
] | null | null | null | import json
import re
class Response:
def handle_response(self, result, counter):
response_result = None
if re.search('^[2][0-9][0-9]$', str(result.status_code)):
response_result = self.__handle_success(result, counter)
elif re.search('^[4][0-9][0-9]$', str(r... | 47.125 | 152 | 0.578249 |
405d7c33bbceea0a2ca99b11b3a41a6dc0aee6e8 | 1,266 | py | Python | projects/solutions/pdb.py | vibbits/gentle-hands-on-python | 32aadd1fa8ebee1089cdbb96a4c64ba06c4a8ced | [
"CC-BY-4.0"
] | null | null | null | projects/solutions/pdb.py | vibbits/gentle-hands-on-python | 32aadd1fa8ebee1089cdbb96a4c64ba06c4a8ced | [
"CC-BY-4.0"
] | 60 | 2020-06-05T13:22:21.000Z | 2022-03-17T08:43:59.000Z | projects/solutions/pdb.py | vibbits/gentle-hands-on-python | 32aadd1fa8ebee1089cdbb96a4c64ba06c4a8ced | [
"CC-BY-4.0"
] | 3 | 2020-04-17T09:46:50.000Z | 2021-09-10T09:41:06.000Z | "Support function for the 3D protein plotting project"
from typing import List, Tuple
from urllib import request
def compare_floats(_a: float, _b: float) -> bool:
"Compare coordinates to PDB format precision"
return abs(_a - _b) < 0.001
def compare_coordinate_lists(
_xs: List[Tuple[float, float, float]... | 26.375 | 81 | 0.64139 |
ff10415cafcd0ea79f0d8bcb0f0072264d5598b5 | 1,214 | py | Python | shopping_buddy/users/utils.py | donvvo/Shop | 21aacde2fcedc1f3e5244a3b29af4aa286216568 | [
"MIT"
] | null | null | null | shopping_buddy/users/utils.py | donvvo/Shop | 21aacde2fcedc1f3e5244a3b29af4aa286216568 | [
"MIT"
] | null | null | null | shopping_buddy/users/utils.py | donvvo/Shop | 21aacde2fcedc1f3e5244a3b29af4aa286216568 | [
"MIT"
] | null | null | null | import facebook
from allauth.socialaccount.models import SocialAccount, SocialToken
from wishlist.models import WishList
def get_facebook_friends(request):
social_account = SocialAccount.objects.get(user=request.user)
social_token = SocialToken.objects.get(account=social_account)
token = social_token
... | 29.609756 | 70 | 0.755354 |
9d898ce0c92c70ed6e3490702f9093b339a5ae65 | 4,844 | py | Python | models.py | TCherici/RoboticAuxiliaryLosses | e71f22d33b4b7b9acc91365e31f595d85fad10fa | [
"MIT"
] | null | null | null | models.py | TCherici/RoboticAuxiliaryLosses | e71f22d33b4b7b9acc91365e31f595d85fad10fa | [
"MIT"
] | null | null | null | models.py | TCherici/RoboticAuxiliaryLosses | e71f22d33b4b7b9acc91365e31f595d85fad10fa | [
"MIT"
] | null | null | null | import tensorflow as tf
import tensorflow.contrib as tc
class Model(object):
def __init__(self, name):
self.name = name
@property
def vars(self):
repr_vars_ = tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, scope=self.name+'_repr')
own_vars_ = tf.get_collection(tf.GraphKeys.GLOBA... | 36.69697 | 128 | 0.611065 |
1fe5cf3821e0a76ac79ee7bd6913ce79a1c1dcec | 23,312 | py | Python | src/GEOparse/GEOparse.py | mvonpapen/GEOparse | 06af980e40acc4576a9c183fdd35c33e90c0636c | [
"BSD-3-Clause"
] | null | null | null | src/GEOparse/GEOparse.py | mvonpapen/GEOparse | 06af980e40acc4576a9c183fdd35c33e90c0636c | [
"BSD-3-Clause"
] | null | null | null | src/GEOparse/GEOparse.py | mvonpapen/GEOparse | 06af980e40acc4576a9c183fdd35c33e90c0636c | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from collections import defaultdict
from itertools import groupby
from os import path
from re import match, split, sub
from tempfile import mkdtemp
from pandas import DataFrame, read_csv
from six import StringIO, iteritems
from . import utils
from .GEOTypes import GDS, GPL, GSE, GSM, GDSSubset... | 34.63893 | 88 | 0.55495 |
7b467b94e000da3dd06b2ec0a4df78f0d40aa013 | 406 | py | Python | sdk/python/pulumi_google_native/cloudiot/__init__.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 44 | 2021-04-18T23:00:48.000Z | 2022-02-14T17:43:15.000Z | sdk/python/pulumi_google_native/cloudiot/__init__.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 354 | 2021-04-16T16:48:39.000Z | 2022-03-31T17:16:39.000Z | sdk/python/pulumi_google_native/cloudiot/__init__.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 8 | 2021-04-24T17:46:51.000Z | 2022-01-05T10:40:21.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! ***
from .. import _utilities
import typing
# Make subpackages available:
if typing.TYPE_CHECKING:
import pulumi_google_native.cloudiot.v1 as __v1
... | 27.066667 | 80 | 0.731527 |
c62cd30dc545159bbf49e44de14a49c5ec427217 | 1,590 | py | Python | setup.py | ramwin/tldr-python-client | 5fedb2bd5e030f771f8fb54d2f8b1d0501b50261 | [
"MIT"
] | null | null | null | setup.py | ramwin/tldr-python-client | 5fedb2bd5e030f771f8fb54d2f8b1d0501b50261 | [
"MIT"
] | null | null | null | setup.py | ramwin/tldr-python-client | 5fedb2bd5e030f771f8fb54d2f8b1d0501b50261 | [
"MIT"
] | null | null | null | from pathlib import Path
import re
from setuptools import setup
setup_dir = Path(__file__).resolve().parent
version = re.search(
r'__version__ = "(.*)"',
Path(setup_dir, 'tldr.py').open().read()
)
if version is None:
raise SystemExit("Could not determine version to use")
version = version.group(1)
setup(
... | 30 | 64 | 0.602516 |
5a0b771e512aee6ed7756b043a0c38a05302db3f | 2,873 | py | Python | amy/pydata/checks.py | mattipt/amy | c8c7212fd51d875d22c413781d28e94837a3db2e | [
"MIT"
] | null | null | null | amy/pydata/checks.py | mattipt/amy | c8c7212fd51d875d22c413781d28e94837a3db2e | [
"MIT"
] | 1 | 2019-12-13T11:22:47.000Z | 2019-12-13T11:22:47.000Z | amy/pydata/checks.py | mattipt/amy | c8c7212fd51d875d22c413781d28e94837a3db2e | [
"MIT"
] | null | null | null | from django.conf import settings
from django.core.checks import register, Error, Tags
@register(Tags.urls)
def check_pydata_urls_included_in_urlpatterns(**kwargs):
'''Check that `pydata.urls` is included in amy.urls'''
from config.urls import urlpatterns
from pydata import urls as pydata_urls
errors ... | 33.022989 | 127 | 0.619561 |
3b8c5cecd72fdde70bec4f7bbf994b56de492459 | 4,064 | py | Python | ludwig/encoders/category_encoders.py | Yard1/ludwig | 510455f8d4fcd6b66e76d2c906d2c600fe724093 | [
"Apache-2.0"
] | 1 | 2021-06-26T07:52:12.000Z | 2021-06-26T07:52:12.000Z | ludwig/encoders/category_encoders.py | Yard1/ludwig | 510455f8d4fcd6b66e76d2c906d2c600fe724093 | [
"Apache-2.0"
] | null | null | null | ludwig/encoders/category_encoders.py | Yard1/ludwig | 510455f8d4fcd6b66e76d2c906d2c600fe724093 | [
"Apache-2.0"
] | 1 | 2019-09-05T09:19:39.000Z | 2019-09-05T09:19:39.000Z | #! /usr/bin/env python
# coding=utf-8
# Copyright (c) 2019 Uber Technologies, 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
#
# Unles... | 32 | 84 | 0.627461 |
c1701e7921e1b79fac6277fa23627a59abb09b4d | 7,622 | py | Python | SMBcorr/merra_hybrid_cumulative.py | SmithB/SMBcorr | 7c35cf8383058986fd82b28beab3c5580f9f8667 | [
"MIT"
] | null | null | null | SMBcorr/merra_hybrid_cumulative.py | SmithB/SMBcorr | 7c35cf8383058986fd82b28beab3c5580f9f8667 | [
"MIT"
] | null | null | null | SMBcorr/merra_hybrid_cumulative.py | SmithB/SMBcorr | 7c35cf8383058986fd82b28beab3c5580f9f8667 | [
"MIT"
] | 1 | 2020-08-06T19:48:52.000Z | 2020-08-06T19:48:52.000Z | #!/usr/bin/env python
u"""
merra_hybrid_cumulative.py
Written by Tyler Sutterley (10/2019)
Calculates cumulative anomalies of MERRA-2 hybrid surface mass balance products
MERRA-2 Hybrid model outputs provided by Brooke Medley at GSFC
CALLING SEQUENCE:
python merra_hybrid_cumulative.py --directory=<path> --regi... | 38.887755 | 80 | 0.64445 |
58356c81fd56d9232f9ab80ed2bca7f8ea4417cd | 409 | py | Python | reporting_engine/reporting_engine/asgi.py | biednick/ftf-re-api | a566736cc62cf49e6e83a515382f1f42b43706e9 | [
"MIT"
] | 2 | 2021-02-15T17:36:17.000Z | 2021-02-26T21:08:50.000Z | reporting_engine/reporting_engine/asgi.py | biednick/ftf-re-api | a566736cc62cf49e6e83a515382f1f42b43706e9 | [
"MIT"
] | 2 | 2021-03-01T19:03:31.000Z | 2021-03-10T00:54:51.000Z | reporting_engine/reporting_engine/asgi.py | biednick/ftf-re-api | a566736cc62cf49e6e83a515382f1f42b43706e9 | [
"MIT"
] | 4 | 2021-02-14T01:23:40.000Z | 2021-02-19T14:20:37.000Z | """
ASGI config for reporting_engine project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJA... | 24.058824 | 78 | 0.794621 |
0326afacf51b44001df1c8958572ed6efbdef14e | 654 | py | Python | secrethash.py | chwarner1/unicorn_api_proxy | b20d9ca6c0c67e29c05dafcafffebd7023fdb62b | [
"MIT"
] | 1 | 2019-02-04T11:45:17.000Z | 2019-02-04T11:45:17.000Z | secrethash.py | chwarner1/unicorn_api_proxy | b20d9ca6c0c67e29c05dafcafffebd7023fdb62b | [
"MIT"
] | null | null | null | secrethash.py | chwarner1/unicorn_api_proxy | b20d9ca6c0c67e29c05dafcafffebd7023fdb62b | [
"MIT"
] | 1 | 2019-03-29T05:00:06.000Z | 2019-03-29T05:00:06.000Z | import glob
import hashlib
class hasher:
def __init__(self):
self.hash_md5 = hashlib.md5()
self.hexdigest = ''
def _update(self, fname):
with open(fname, "rb") as f:
for chunk in iter(lambda: f.read(2 ** 20), b""):
self.hash_md5.update(chunk)
self.h... | 26.16 | 60 | 0.599388 |
285a118c9c2bb5df58a88d88969fa85cbcb527d7 | 2,819 | py | Python | backend/main/server/resources/Announcement.py | Nael-Nathanael/holocn-graduation | ebe63731abf8c7ee74e1eb66fed810b794ce7712 | [
"MIT"
] | 22 | 2020-08-18T23:12:43.000Z | 2021-07-01T13:24:49.000Z | backend/main/server/resources/Announcement.py | Nael-Nathanael/holocn-graduation | ebe63731abf8c7ee74e1eb66fed810b794ce7712 | [
"MIT"
] | 51 | 2020-08-19T19:59:15.000Z | 2021-11-04T16:16:25.000Z | backend/main/server/resources/Announcement.py | Manotomo-Alliance-Support-Squad/WWS | 3df21a3f715eeb3b57314bf08c38f2239b2ba399 | [
"MIT"
] | 15 | 2020-08-19T02:39:17.000Z | 2022-02-07T01:57:53.000Z | from flask_restful import Resource
from flask import request
from main.server import db, cache, app
from main.server.models import Announcement, AnnouncementSchema
from flask_jwt import jwt_required
announcement_schema = AnnouncementSchema()
announcements_schema = AnnouncementSchema(many=True)
@app.after_request
def ... | 35.683544 | 182 | 0.680028 |
59fe166197d7cc994fb55ea012a5b1316f56dfd3 | 11,383 | py | Python | venv/lib/python2.7/site-packages/urwid/tests/test_vterm.py | ShawnLeee/django-project | 3531c3489e962272786b8bcf5818aeb94885f2d4 | [
"MIT"
] | 39 | 2015-04-09T12:55:25.000Z | 2022-01-09T17:56:39.000Z | venv/lib/python2.7/site-packages/urwid/tests/test_vterm.py | ShawnLeee/django-project | 3531c3489e962272786b8bcf5818aeb94885f2d4 | [
"MIT"
] | null | null | null | venv/lib/python2.7/site-packages/urwid/tests/test_vterm.py | ShawnLeee/django-project | 3531c3489e962272786b8bcf5818aeb94885f2d4 | [
"MIT"
] | 13 | 2015-12-17T21:56:26.000Z | 2019-06-01T18:22:02.000Z | # Urwid terminal emulation widget unit tests
# Copyright (C) 2010 aszlig
# Copyright (C) 2011 Ian Ward
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# versi... | 33.979104 | 106 | 0.571203 |
1335e50c1083cc24a3def8e73ad11cca4010675e | 481 | py | Python | data/scripts/templates/object/tangible/ship/crafted/chassis/shared_hutt_medium_s01_deed.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/ship/crafted/chassis/shared_hutt_medium_s01_deed.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/ship/crafted/chassis/shared_hutt_medium_s01_deed.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/crafted/chassis/shared_hutt_medium_s01_deed.iff"
result.attrib... | 28.294118 | 89 | 0.744283 |
2031b0e6eb9291f0327fdc8f217742e53c16a54b | 87,711 | py | Python | gpMgmt/bin/gppylib/operations/test/unit/test_unit_persistent_rebuild.py | lintzc/GPDB | b48c8b97da18f495c10065d0853db87960aebae2 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | gpMgmt/bin/gppylib/operations/test/unit/test_unit_persistent_rebuild.py | lintzc/GPDB | b48c8b97da18f495c10065d0853db87960aebae2 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | gpMgmt/bin/gppylib/operations/test/unit/test_unit_persistent_rebuild.py | lintzc/GPDB | b48c8b97da18f495c10065d0853db87960aebae2 | [
"PostgreSQL",
"Apache-2.0"
] | 1 | 2018-12-04T09:13:57.000Z | 2018-12-04T09:13:57.000Z | #!/usr/bin/env python
#
# Copyright (c) Pivotal Inc 2014. All Rights Reserved.
#
import os
import re
import shutil
import unittest2 as unittest
from collections import defaultdict
from gppylib.gpversion import GpVersion
from gppylib.commands.base import Command, CommandResult, ExecutionError
from mock import patch, Ma... | 59.911885 | 151 | 0.657135 |
bcb351984a1752986d5a06e00910b2f036ec0e8b | 1,908 | py | Python | tests/accelerators/test_cpu.py | Rubiel1/pytorch-lightning | 0995d30fab0590d155895a77535663794118b5f6 | [
"Apache-2.0"
] | null | null | null | tests/accelerators/test_cpu.py | Rubiel1/pytorch-lightning | 0995d30fab0590d155895a77535663794118b5f6 | [
"Apache-2.0"
] | null | null | null | tests/accelerators/test_cpu.py | Rubiel1/pytorch-lightning | 0995d30fab0590d155895a77535663794118b5f6 | [
"Apache-2.0"
] | null | null | null | from unittest.mock import Mock
import pytest
import torch
from pytorch_lightning import Trainer
from pytorch_lightning.accelerators import CPUAccelerator
from pytorch_lightning.plugins import SingleDevicePlugin
from pytorch_lightning.plugins.precision import MixedPrecisionPlugin
from pytorch_lightning.utilities.excep... | 34.690909 | 109 | 0.719602 |
89b3f11f721e992ceb87b9599b9ca2bd026b179a | 1,641 | py | Python | scripts/Sismograma.py | marcelocg98/seismic_modeling_RTM | 8ee704a6ea281f9bebba803253d3e98645c0ef4b | [
"MIT"
] | 2 | 2021-02-25T09:27:06.000Z | 2021-03-12T02:15:17.000Z | scripts/Sismograma.py | marcelocg98/seismic_modeling_RTM | 8ee704a6ea281f9bebba803253d3e98645c0ef4b | [
"MIT"
] | null | null | null | scripts/Sismograma.py | marcelocg98/seismic_modeling_RTM | 8ee704a6ea281f9bebba803253d3e98645c0ef4b | [
"MIT"
] | null | null | null | from mpl_toolkits.axes_grid1 import make_axes_locatable
import matplotlib.pyplot as plt
from Operador import Operador
import os.path
class Sismograma(Operador):
def __init__(self):
Operador.__init__(self)
def sis_plot(self, cmap='gray'):
## Eixos em dimensões reais
scaleX = 1.0 / ... | 33.489796 | 134 | 0.609994 |
069a38693d9c1c34511310688863a8251c883743 | 7,284 | py | Python | plugins/cliconf/fujitsu_sir.py | takamitsu-iida/ansible-fujitsu-devices | 077c5c0e6e7b186e7ec23cb973557d393b435dbc | [
"MIT"
] | 1 | 2020-04-04T05:45:55.000Z | 2020-04-04T05:45:55.000Z | plugins/cliconf/fujitsu_sir.py | takamitsu-iida/ansible-fujitsu-devices | 077c5c0e6e7b186e7ec23cb973557d393b435dbc | [
"MIT"
] | null | null | null | plugins/cliconf/fujitsu_sir.py | takamitsu-iida/ansible-fujitsu-devices | 077c5c0e6e7b186e7ec23cb973557d393b435dbc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
"""plugins/cliconf/fujitsu_sir.py
cliconf plugin for fujitsu_sir
Takamitsu IIDA (@takamitsu-iida)
"""
import collections
import json
import re
from ansible.errors impo... | 31.80786 | 126 | 0.656233 |
d7c63d151e9cee02ab02a9fd983e22df727d1889 | 98 | py | Python | eventex/core/views.py | ewdemy/wttd | aad88fca324b397ab4eb591ccab66efa07d9344e | [
"MIT"
] | null | null | null | eventex/core/views.py | ewdemy/wttd | aad88fca324b397ab4eb591ccab66efa07d9344e | [
"MIT"
] | 5 | 2021-04-08T18:42:57.000Z | 2022-02-10T10:48:01.000Z | eventex/core/views.py | ewdemy/wttd | aad88fca324b397ab4eb591ccab66efa07d9344e | [
"MIT"
] | null | null | null | from django.shortcuts import render
def home(request):
return render(request,'index.html') | 24.5 | 39 | 0.744898 |
afdd8d87a86e103f58a2b4c46608b6d26a993997 | 7,228 | py | Python | recurrentmodule/recurrent_attn.py | mkmysk123456789/Informer2020 | ad4b895169a17db580aab6d2c09fd07e06c9b6fa | [
"Apache-2.0"
] | 1 | 2021-07-05T11:20:07.000Z | 2021-07-05T11:20:07.000Z | recurrentmodule/recurrent_attn.py | mkmysk123456789/Informer2020 | ad4b895169a17db580aab6d2c09fd07e06c9b6fa | [
"Apache-2.0"
] | null | null | null | recurrentmodule/recurrent_attn.py | mkmysk123456789/Informer2020 | ad4b895169a17db580aab6d2c09fd07e06c9b6fa | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from math import sqrt
from utils.masking import Recurrent_TriangularCausalMask
class Recurrent_FullAttention(nn.Module):
def __init__(self, mask_flag=False, factor=5, scale=None, attention_dropout=0.1, output_attention=False, ... | 35.782178 | 122 | 0.597676 |
c36186f2b128fbf0f45d342d527b29fa54466053 | 2,391 | py | Python | asv/commands/setup.py | pitrou/asv | d6efa34f1308a212bc3c2f386f2f6584bbb5398f | [
"BSD-3-Clause"
] | null | null | null | asv/commands/setup.py | pitrou/asv | d6efa34f1308a212bc3c2f386f2f6584bbb5398f | [
"BSD-3-Clause"
] | null | null | null | asv/commands/setup.py | pitrou/asv | d6efa34f1308a212bc3c2f386f2f6584bbb5398f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from . import Command
from ..console import log
from .. import environment
from .. import util
def _install_requirement... | 30.265823 | 74 | 0.623588 |
74578a1982abedcbb77901f2eba4cc30aaeb5283 | 2,217 | py | Python | botorum/servicecatalog/models/__init__.py | jpwhite3/botorum | c5d5072ae621498e7296a7180be5fcf0b5f2b437 | [
"MIT"
] | 1 | 2021-05-07T16:16:54.000Z | 2021-05-07T16:16:54.000Z | botorum/servicecatalog/models/__init__.py | jpwhite3/botorum | c5d5072ae621498e7296a7180be5fcf0b5f2b437 | [
"MIT"
] | 123 | 2018-11-26T15:58:20.000Z | 2021-11-08T10:20:39.000Z | botorum/servicecatalog/models/__init__.py | jpwhite3/botorum | c5d5072ae621498e7296a7180be5fcf0b5f2b437 | [
"MIT"
] | null | null | null | import abc
import six
import boto3
from botorum.common import camel_to_snake
@six.add_metaclass(abc.ABCMeta)
class BaseModel():
session = boto3.Session()
def __init__(self, **object_attrs):
self._set_attrs(**object_attrs)
def __getattr__(self, name):
attr_name = camel_to_snake(name)
... | 26.082353 | 116 | 0.643663 |
1f9962201f0326bdfe3a9878f0c0a16e2e606839 | 1,982 | py | Python | glusterfs/tests/conftest.py | mchelen-gov/integrations-core | 81281600b3cc7025a7a32148c59620c9592a564f | [
"BSD-3-Clause"
] | 663 | 2016-08-23T05:23:45.000Z | 2022-03-29T00:37:23.000Z | glusterfs/tests/conftest.py | mchelen-gov/integrations-core | 81281600b3cc7025a7a32148c59620c9592a564f | [
"BSD-3-Clause"
] | 6,642 | 2016-06-09T16:29:20.000Z | 2022-03-31T22:24:09.000Z | glusterfs/tests/conftest.py | mchelen-gov/integrations-core | 81281600b3cc7025a7a32148c59620c9592a564f | [
"BSD-3-Clause"
] | 1,222 | 2017-01-27T15:51:38.000Z | 2022-03-31T18:17:51.000Z | # (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
import time
import mock
import pytest
from datadog_checks.base.utils.common import get_docker_hostname
from datadog_checks.dev import WaitFor, docker_run, run_command
from .common import CONFI... | 30.96875 | 113 | 0.680626 |
b9ab028a5c83a83909816c559b6c7acb7fd3924f | 6,770 | py | Python | common/py_utils/py_utils/discover.py | Martijnve23/catapult | 5c63b19d221af6a12889e8727acc85d93892cab7 | [
"BSD-3-Clause"
] | 1 | 2021-07-04T03:26:43.000Z | 2021-07-04T03:26:43.000Z | common/py_utils/py_utils/discover.py | Martijnve23/catapult | 5c63b19d221af6a12889e8727acc85d93892cab7 | [
"BSD-3-Clause"
] | null | null | null | common/py_utils/py_utils/discover.py | Martijnve23/catapult | 5c63b19d221af6a12889e8727acc85d93892cab7 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
import fnmatch
import importlib
import inspect
import os
import re
import sys
from py_utils import camel_case
def D... | 35.445026 | 80 | 0.694682 |
94e8f99ca5a0bc893ae18bd50463e4bbb47ab4c8 | 5,350 | py | Python | aliyun-python-sdk-ens/aliyunsdkens/request/v20171110/CreateInstanceRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-ens/aliyunsdkens/request/v20171110/CreateInstanceRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-ens/aliyunsdkens/request/v20171110/CreateInstanceRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38.768116 | 74 | 0.752897 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.