hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2492ae299ea74d6380967fa73b96fa1c2554c9 | 1,106 | py | Python | containers/api/tests/auth/test_login_post.py | yveso/supertoll | 0623c090ab97d5fb24dba6c18373c7cf8bc27e46 | [
"MIT"
] | null | null | null | containers/api/tests/auth/test_login_post.py | yveso/supertoll | 0623c090ab97d5fb24dba6c18373c7cf8bc27e46 | [
"MIT"
] | 8 | 2019-12-26T17:26:07.000Z | 2022-02-26T10:41:53.000Z | containers/api/tests/auth/test_login_post.py | yveso/supertoll | 0623c090ab97d5fb24dba6c18373c7cf8bc27e46 | [
"MIT"
] | null | null | null | import tests.helpers as helpers
def post(client, payload):
return helpers.post_json(client, "/auth/login", payload)
def test_registered_user_logs_in(client):
helpers.add_user(
username="Test", email="test@test.org", password="password123"
)
response, data = post(
client, {"email": "t... | 28.358974 | 70 | 0.68264 | import tests.helpers as helpers
def post(client, payload):
return helpers.post_json(client, "/auth/login", payload)
def test_registered_user_logs_in(client):
helpers.add_user(
username="Test", email="test@test.org", password="password123"
)
response, data = post(
client, {"email": "t... | true | true |
1c24931fd18c9a2f0ecf866433a1c1295a0ef148 | 1,771 | py | Python | result-collectors/utils/k8s.py | my5G/OPlaceRAN | cc6fe5223b9b2a32d7963b2304762fe2a0265298 | [
"Apache-2.0"
] | 1 | 2022-02-22T07:19:59.000Z | 2022-02-22T07:19:59.000Z | result-collectors/utils/k8s.py | my5G/OPlaceRAN | cc6fe5223b9b2a32d7963b2304762fe2a0265298 | [
"Apache-2.0"
] | 1 | 2022-01-15T20:26:01.000Z | 2022-01-15T20:26:01.000Z | result-collectors/utils/k8s.py | my5G/OPlaceRAN | cc6fe5223b9b2a32d7963b2304762fe2a0265298 | [
"Apache-2.0"
] | 1 | 2022-01-07T18:49:10.000Z | 2022-01-07T18:49:10.000Z | from kubernetes import config, client
from kubernetes.client.rest import ApiException
from tenacity import retry, stop_after_delay, retry_if_exception_type, TryAgain, wait_fixed
import utils.constants as constants
import logging
class K8S:
@staticmethod
def get_client():
"""
Gets a K8S cl... | 31.625 | 101 | 0.6262 | from kubernetes import config, client
from kubernetes.client.rest import ApiException
from tenacity import retry, stop_after_delay, retry_if_exception_type, TryAgain, wait_fixed
import utils.constants as constants
import logging
class K8S:
@staticmethod
def get_client():
return config.new_client_from... | true | true |
1c24932c6c9f3fe07d9f21ed439ee28cfa8affc0 | 1,248 | py | Python | get_files.py | SreeHarshaNelaturu/runway-transformers-CTRL | a7f38ed8999eac90f0e17185ec5e7d138f0ddb9f | [
"Apache-2.0"
] | null | null | null | get_files.py | SreeHarshaNelaturu/runway-transformers-CTRL | a7f38ed8999eac90f0e17185ec5e7d138f0ddb9f | [
"Apache-2.0"
] | null | null | null | get_files.py | SreeHarshaNelaturu/runway-transformers-CTRL | a7f38ed8999eac90f0e17185ec5e7d138f0ddb9f | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
# 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
#
#Unless requir... | 30.439024 | 82 | 0.791667 |
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import logging
from tqdm import trange
import torch
import torch.nn.functional as F
import numpy as np
from transformers import CTRLConfig
from transformers import CTRLLMHeadModel, CTRLTokenizer
from ru... | true | true |
1c2493f82c05ecfee1738fb2466f60c57b7ca0ca | 3,838 | py | Python | actstream/actions.py | michaeljones/django-activity-stream | d32db0c352dd6b1dbccd32b6bbbe8993b3e8b5b9 | [
"BSD-3-Clause"
] | null | null | null | actstream/actions.py | michaeljones/django-activity-stream | d32db0c352dd6b1dbccd32b6bbbe8993b3e8b5b9 | [
"BSD-3-Clause"
] | null | null | null | actstream/actions.py | michaeljones/django-activity-stream | d32db0c352dd6b1dbccd32b6bbbe8993b3e8b5b9 | [
"BSD-3-Clause"
] | null | null | null | import datetime
from django.utils.translation import ugettext_lazy as _
from django.utils.six import text_type
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from actstream import settings
from actstream.signals import action
from actstream.registry import chec... | 31.203252 | 79 | 0.67457 | import datetime
from django.utils.translation import ugettext_lazy as _
from django.utils.six import text_type
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from actstream import settings
from actstream.signals import action
from actstream.registry import chec... | true | true |
1c249438384619dab4ba5e4e6af564748fc04c84 | 292,616 | py | Python | isi_mip/pages/migrations/0011_auto_20160518_1004.py | ISI-MIP/isimip | c2a78c727337e38f3695031e00afd607da7d6dcb | [
"MIT"
] | 4 | 2017-07-05T08:06:18.000Z | 2021-03-01T17:23:18.000Z | isi_mip/pages/migrations/0011_auto_20160518_1004.py | ISI-MIP/isimip | c2a78c727337e38f3695031e00afd607da7d6dcb | [
"MIT"
] | 4 | 2020-01-31T09:02:57.000Z | 2021-04-20T14:04:35.000Z | isi_mip/pages/migrations/0011_auto_20160518_1004.py | ISI-MIP/isimip | c2a78c727337e38f3695031e00afd607da7d6dcb | [
"MIT"
] | 4 | 2017-10-12T01:48:55.000Z | 2020-04-29T13:50:03.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-18 08:04
from __future__ import unicode_literals
from django.db import migrations
import isi_mip.contrib.blocks
import isi_mip.pages.blocks
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.documents.blocks
import wagtail.embeds.blocks
i... | 3,325.181818 | 32,770 | 0.749265 |
from __future__ import unicode_literals
from django.db import migrations
import isi_mip.contrib.blocks
import isi_mip.pages.blocks
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.documents.blocks
import wagtail.embeds.blocks
import wagtail.images.blocks
class Migration(migrations.Migration):
... | true | true |
1c24947433ba62b59742e4949e66d466c81dcfd3 | 5,634 | py | Python | assignment1/cs231n/classifiers/linear_classifier.py | hanezu/cs231n-assignment | e4c2df9904b703861665626c45aaff21aeece7ae | [
"MIT"
] | null | null | null | assignment1/cs231n/classifiers/linear_classifier.py | hanezu/cs231n-assignment | e4c2df9904b703861665626c45aaff21aeece7ae | [
"MIT"
] | null | null | null | assignment1/cs231n/classifiers/linear_classifier.py | hanezu/cs231n-assignment | e4c2df9904b703861665626c45aaff21aeece7ae | [
"MIT"
] | null | null | null | import numpy as np
from cs231n.classifiers.linear_svm import *
from cs231n.classifiers.softmax import *
class LinearClassifier(object):
def __init__(self):
self.W = None
def train(self, X, y, learning_rate=1e-3, reg=1e-5, num_iters=100,
batch_size=200, verbose=False):
"""
Train this linea... | 41.124088 | 92 | 0.49006 | import numpy as np
from cs231n.classifiers.linear_svm import *
from cs231n.classifiers.softmax import *
class LinearClassifier(object):
def __init__(self):
self.W = None
def train(self, X, y, learning_rate=1e-3, reg=1e-5, num_iters=100,
batch_size=200, verbose=False):
"""
Train this linea... | false | true |
1c249488fb532cc33ada0335c687d6f208c55088 | 345 | py | Python | PythonTests/GPIOTest.py | swank-rats/roboter-software | 1e91b6a9ca6c1abea8d827e07a5282ceaab9ce26 | [
"MIT"
] | null | null | null | PythonTests/GPIOTest.py | swank-rats/roboter-software | 1e91b6a9ca6c1abea8d827e07a5282ceaab9ce26 | [
"MIT"
] | null | null | null | PythonTests/GPIOTest.py | swank-rats/roboter-software | 1e91b6a9ca6c1abea8d827e07a5282ceaab9ce26 | [
"MIT"
] | null | null | null | __author__ = 'Johannes'
import Adafruit_BBIO.GPIO as GPIO
import time
P = "P8_10"
GPIO.setup(P, GPIO.OUT)
for i in xrange(100):
if i % 2 == 0:
GPIO.output(P, GPIO.HIGH)
print "HIGH"
else:
GPIO.output(P, GPIO.LOW)
print "LOW"
time.... | 21.5625 | 41 | 0.521739 | __author__ = 'Johannes'
import Adafruit_BBIO.GPIO as GPIO
import time
P = "P8_10"
GPIO.setup(P, GPIO.OUT)
for i in xrange(100):
if i % 2 == 0:
GPIO.output(P, GPIO.HIGH)
print "HIGH"
else:
GPIO.output(P, GPIO.LOW)
print "LOW"
time.... | false | true |
1c2494be9adabc3acd71601e448a16aaed60d13a | 3,314 | py | Python | pxr/usdImaging/bin/testusdview/testenv/testUsdviewClippingPlanes/testUsdviewClippingPlanes.py | octarrow/USD | 1845291a9701ab0a3a7d591bc243a1a80fdcba8a | [
"Unlicense"
] | 6 | 2018-08-26T13:27:22.000Z | 2021-08-14T23:57:38.000Z | pxr/usdImaging/bin/testusdview/testenv/testUsdviewClippingPlanes/testUsdviewClippingPlanes.py | octarrow/USD | 1845291a9701ab0a3a7d591bc243a1a80fdcba8a | [
"Unlicense"
] | 1 | 2021-08-14T23:57:51.000Z | 2021-08-14T23:57:51.000Z | pxr/usdImaging/bin/testusdview/testenv/testUsdviewClippingPlanes/testUsdviewClippingPlanes.py | octarrow/USD | 1845291a9701ab0a3a7d591bc243a1a80fdcba8a | [
"Unlicense"
] | 4 | 2018-06-14T18:14:59.000Z | 2021-09-13T22:20:50.000Z | #!/pxrpythonsubst
#
# Copyright 2017 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... | 38.534884 | 82 | 0.785154 |
from pxr import Gf
def _modifySettings(appController):
appController._dataModel.viewSettings.showBBoxes = False
appController._dataModel.viewSettings.showHUD = False
def _setClippingPlaneOverrides(appController, near=None, far=None):
appController._stageView.overrideNear = near
... | true | true |
1c2494e7d6b09f26bed8e86fbc420684e58ac491 | 67,602 | py | Python | pandas/tests/test_generic.py | michaelaye/pandas | c6110e25b3eceb2f25022c2aa9ccea03c0b8b359 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | 3 | 2017-02-25T14:06:43.000Z | 2017-05-25T05:18:03.000Z | pandas/tests/test_generic.py | michaelaye/pandas | c6110e25b3eceb2f25022c2aa9ccea03c0b8b359 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | 11 | 2020-06-05T17:24:17.000Z | 2022-03-11T23:15:26.000Z | pandas/tests/test_generic.py | michaelaye/pandas | c6110e25b3eceb2f25022c2aa9ccea03c0b8b359 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | 3 | 2017-02-25T15:26:47.000Z | 2017-12-20T06:27:07.000Z | # -*- coding: utf-8 -*-
# pylint: disable-msg=E1101,W0612
from operator import methodcaller
import nose
import numpy as np
from numpy import nan
import pandas as pd
from pandas import (Index, Series, DataFrame, Panel, isnull,
date_range, period_range, Panel4D)
from pandas.core.index import MultiIn... | 36.286634 | 79 | 0.533786 |
from operator import methodcaller
import nose
import numpy as np
from numpy import nan
import pandas as pd
from pandas import (Index, Series, DataFrame, Panel, isnull,
date_range, period_range, Panel4D)
from pandas.core.index import MultiIndex
import pandas.formats.printing as printing
import p... | true | true |
1c24950ed84297a0ae99dc620883cdb2d8669a61 | 3,065 | py | Python | texapi/settings/preproduction.py | blumug/texapi | 3caf1dd3f0c641a06964a33f7d3046bdace24eeb | [
"MIT"
] | null | null | null | texapi/settings/preproduction.py | blumug/texapi | 3caf1dd3f0c641a06964a33f7d3046bdace24eeb | [
"MIT"
] | null | null | null | texapi/settings/preproduction.py | blumug/texapi | 3caf1dd3f0c641a06964a33f7d3046bdace24eeb | [
"MIT"
] | null | null | null | """Production settings and globals."""
from os import environ
from base import *
# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
from django.core.exceptions import ImproperlyConfigured
def get_env_setting(setting):
""" Get the envi... | 31.597938 | 99 | 0.702121 |
from os import environ
from base import *
from django.core.exceptions import ImproperlyConfigured
def get_env_setting(setting):
try:
return environ[setting]
except KeyError:
error_msg = "Set the %s env variable" % setting
raise ImproperlyConfigured(error_msg)
| true | true |
1c2495460b6e97e6a9f393b19051ca250324d9ad | 5,037 | py | Python | Lab 1/Project/gui_socket_server.py | kchaitanya863/CSE-5306-DISTRIBUTED-SYSTEMS | e9810d6ab9824821d18d7e61faf33a90df954a52 | [
"MIT"
] | null | null | null | Lab 1/Project/gui_socket_server.py | kchaitanya863/CSE-5306-DISTRIBUTED-SYSTEMS | e9810d6ab9824821d18d7e61faf33a90df954a52 | [
"MIT"
] | null | null | null | Lab 1/Project/gui_socket_server.py | kchaitanya863/CSE-5306-DISTRIBUTED-SYSTEMS | e9810d6ab9824821d18d7e61faf33a90df954a52 | [
"MIT"
] | null | null | null | from tkinter import *
from datetime import datetime
import threading
import socket
import time
import random
# declarations
root = Tk()
root.title('Server')
server_status = Label(root, text="Server: offline")
server_status.pack()
information_panel = Text()
information_panel.pack()
information_panel['state'] = DISABLE... | 28.948276 | 109 | 0.655946 | from tkinter import *
from datetime import datetime
import threading
import socket
import time
import random
root = Tk()
root.title('Server')
server_status = Label(root, text="Server: offline")
server_status.pack()
information_panel = Text()
information_panel.pack()
information_panel['state'] = DISABLED
all_connecti... | true | true |
1c2495692d54ce7b308fa83b45b60fa3fb95d2c7 | 4,965 | py | Python | readthedocs/restapi/views/footer_views.py | gamearming/readthedocs | 53d0094f657f549326a86b8bd0ccf924c2126941 | [
"MIT"
] | null | null | null | readthedocs/restapi/views/footer_views.py | gamearming/readthedocs | 53d0094f657f549326a86b8bd0ccf924c2126941 | [
"MIT"
] | null | null | null | readthedocs/restapi/views/footer_views.py | gamearming/readthedocs | 53d0094f657f549326a86b8bd0ccf924c2126941 | [
"MIT"
] | null | null | null | from django.shortcuts import get_object_or_404
from django.template import RequestContext, loader as template_loader
from django.conf import settings
from rest_framework import decorators, permissions
from rest_framework.renderers import JSONRenderer
from rest_framework.response import Response
from rest_framework_js... | 40.365854 | 93 | 0.69003 | from django.shortcuts import get_object_or_404
from django.template import RequestContext, loader as template_loader
from django.conf import settings
from rest_framework import decorators, permissions
from rest_framework.renderers import JSONRenderer
from rest_framework.response import Response
from rest_framework_js... | true | true |
1c2495eb827f10b6262c533f73210e8be7c21a65 | 340 | py | Python | sumoftwo.py | itspuneet/itspuneet | d44f78afcff275aa56f03bba738ac3e4f2c30843 | [
"bzip2-1.0.6"
] | null | null | null | sumoftwo.py | itspuneet/itspuneet | d44f78afcff275aa56f03bba738ac3e4f2c30843 | [
"bzip2-1.0.6"
] | null | null | null | sumoftwo.py | itspuneet/itspuneet | d44f78afcff275aa56f03bba738ac3e4f2c30843 | [
"bzip2-1.0.6"
] | null | null | null | N = int(input())
i=0
# Get the array
numArray1 = list(map(int, input().split()))
numArray2 = list(map(int, input().split()))
sumArray = []
# Write the logic here:
while i<N:
sumArray[i]=(numArray1[i]+numArray2[i])
i+=1
# Print the sumArray
for element in sumArray:
print(element, end=" "... | 17 | 44 | 0.585294 | N = int(input())
i=0
numArray1 = list(map(int, input().split()))
numArray2 = list(map(int, input().split()))
sumArray = []
while i<N:
sumArray[i]=(numArray1[i]+numArray2[i])
i+=1
for element in sumArray:
print(element, end=" ")
print("")
| true | true |
1c249729a8367a591d37275489d8f89f081743ca | 8,882 | py | Python | Chapter10/Ch10_Code/import_OpenGL_cube_and_cone.py | mr4dsd43/Python-GUI-Programming-Cookbook-Second-Edition | 18e4632106169991e9b75680bdd7250c9d77c3be | [
"MIT"
] | 2 | 2021-01-12T03:13:29.000Z | 2021-01-12T03:13:31.000Z | Chapter10/Ch10_Code/import_OpenGL_cube_and_cone.py | mr4dsd43/Python-GUI-Programming-Cookbook-Second-Edition | 18e4632106169991e9b75680bdd7250c9d77c3be | [
"MIT"
] | null | null | null | Chapter10/Ch10_Code/import_OpenGL_cube_and_cone.py | mr4dsd43/Python-GUI-Programming-Cookbook-Second-Edition | 18e4632106169991e9b75680bdd7250c9d77c3be | [
"MIT"
] | 1 | 2019-05-24T19:16:36.000Z | 2019-05-24T19:16:36.000Z | '''
May 2017
Example from: https://wiki.wxpython.org/GLCanvas%20update
@author: Burkhard A. Meier
'''
# Dragging the mouse rotates the view of the 3D cube or cone.
import wx
import sys
from wx import glcanvas
from OpenGL.GL import *
from OpenGL.GLUT import *
#---------------------------------------------------------... | 31.385159 | 111 | 0.528372 |
import wx
import sys
from wx import glcanvas
from OpenGL.GL import *
from OpenGL.GLUT import *
buttonDefs = {
wx.NewId() : ('CubeCanvas', 'Cube'),
wx.NewId() : ('ConeCanvas', 'Cone')
}
class ButtonPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent, -1)
bo... | true | true |
1c24974282d76e402719479b3e5c822e1f575bd1 | 3,273 | py | Python | processor/marketplace_processor/handler.py | NeelNetwork/Neel-Core | 2ce3e012024ccbcbadbd03ee51c4fa5f05f50be9 | [
"Apache-2.0"
] | null | null | null | processor/marketplace_processor/handler.py | NeelNetwork/Neel-Core | 2ce3e012024ccbcbadbd03ee51c4fa5f05f50be9 | [
"Apache-2.0"
] | null | null | null | processor/marketplace_processor/handler.py | NeelNetwork/Neel-Core | 2ce3e012024ccbcbadbd03ee51c4fa5f05f50be9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Intel Corporation
#
# 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 wri... | 36.775281 | 79 | 0.670027 |
from sawtooth_sdk.processor.exceptions import InvalidTransaction
from sawtooth_sdk.processor.handler import TransactionHandler
from marketplace_addressing import addresser
from marketplace_processor.account import account_creation
from marketplace_processor.asset import asset_creation
from marketplace_... | true | true |
1c2497e4bce04060c78fd949db349ddd7f805ffc | 2,719 | py | Python | dyndns.py | thomascoe/tac-dyndns | 365ccb49b4b275ac354e71a6b899be4aaaefc0b4 | [
"MIT"
] | null | null | null | dyndns.py | thomascoe/tac-dyndns | 365ccb49b4b275ac354e71a6b899be4aaaefc0b4 | [
"MIT"
] | 1 | 2018-08-20T13:58:52.000Z | 2018-08-25T18:39:43.000Z | dyndns.py | thomascoe/tac-dyndns | 365ccb49b4b275ac354e71a6b899be4aaaefc0b4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
import os
import json
import re
import urllib
import urllib2
# Basic Dynamic DNS update client. Written around the no-ip.com API.
# Supports determining your public IP by querying an external web service, or by
# using an IP address from a local interface
#
# Reads in config from a JS... | 28.030928 | 90 | 0.662008 |
import sys
import os
import json
import re
import urllib
import urllib2
program = "tac-dyndns"
version = "1.0"
contact = "thomascoe1@gmail.com"
baseUrl = "https://dynupdate.no-ip.com/nic/update"
if (len(sys.argv) != 2):
print ("usage: %s config.json" % sys.argv[0])
exit()
filename = sys.ar... | false | true |
1c2497eb7ae9749bc2c8faef7eeb076762c6afb0 | 1,173 | py | Python | tests/util_test.py | manifest/flax-extra | e19de992c7acefefca9ed4c9f7ce3e092943363a | [
"Apache-2.0"
] | null | null | null | tests/util_test.py | manifest/flax-extra | e19de992c7acefefca9ed4c9f7ce3e092943363a | [
"Apache-2.0"
] | 3 | 2021-08-10T04:59:35.000Z | 2021-10-07T21:10:37.000Z | tests/util_test.py | manifest/flax-extra | e19de992c7acefefca9ed4c9f7ce3e092943363a | [
"Apache-2.0"
] | null | null | null | import unittest
import jax
from jax import numpy as jnp
import numpy as np
from flax_extra.util import batch_per_device, originate
class OriginateTest(unittest.TestCase):
def test(self):
n_devices = 2
original_x = jnp.ones((4, 3))
replicated_x = jnp.ones((n_devices, 4, 3))
value = ... | 28.609756 | 66 | 0.612106 | import unittest
import jax
from jax import numpy as jnp
import numpy as np
from flax_extra.util import batch_per_device, originate
class OriginateTest(unittest.TestCase):
def test(self):
n_devices = 2
original_x = jnp.ones((4, 3))
replicated_x = jnp.ones((n_devices, 4, 3))
value = ... | true | true |
1c2498d8fa1aca3ce43dbbfde1b97cfce386aada | 1,765 | py | Python | rest/auth/views.py | wq/wq.db | 6004f7ba479fa5dc528d711307160c0e8f301a10 | [
"MIT"
] | 86 | 2015-02-02T06:14:51.000Z | 2022-02-21T22:23:10.000Z | rest/auth/views.py | wq/wq.db | 6004f7ba479fa5dc528d711307160c0e8f301a10 | [
"MIT"
] | 55 | 2015-03-20T01:28:51.000Z | 2021-12-16T14:47:30.000Z | rest/auth/views.py | wq/wq.db | 6004f7ba479fa5dc528d711307160c0e8f301a10 | [
"MIT"
] | 22 | 2015-05-15T23:05:24.000Z | 2022-01-17T11:26:30.000Z | from django.contrib.auth import authenticate, login, logout
from django.middleware import csrf
from rest_framework.response import Response
from rest_framework.exceptions import AuthenticationFailed
from wq.db import rest
from wq.db.rest.models import get_object_id
from wq.db.rest.views import SimpleViewSet
from .seria... | 32.685185 | 77 | 0.668555 | from django.contrib.auth import authenticate, login, logout
from django.middleware import csrf
from rest_framework.response import Response
from rest_framework.exceptions import AuthenticationFailed
from wq.db import rest
from wq.db.rest.models import get_object_id
from wq.db.rest.views import SimpleViewSet
from .seria... | true | true |
1c2499e4e99e139fa994a9594de3c73d45064ac7 | 344 | py | Python | blog/models.py | ProjetoALES/TutorialDjango | 41dc001b3d4aba5b474646b0140a5b4c7ad11043 | [
"MIT"
] | null | null | null | blog/models.py | ProjetoALES/TutorialDjango | 41dc001b3d4aba5b474646b0140a5b4c7ad11043 | [
"MIT"
] | null | null | null | blog/models.py | ProjetoALES/TutorialDjango | 41dc001b3d4aba5b474646b0140a5b4c7ad11043 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
class Post(models.Model):
title = models.CharField(max_length=30)
post = models.TextField()
created = models.DateTimeField(auto_now_add=True)
author = models.ForeignKey(
User,
on_delete=models.CASCADE,
rel... | 24.571429 | 53 | 0.694767 | from django.db import models
from django.contrib.auth.models import User
class Post(models.Model):
title = models.CharField(max_length=30)
post = models.TextField()
created = models.DateTimeField(auto_now_add=True)
author = models.ForeignKey(
User,
on_delete=models.CASCADE,
rel... | true | true |
1c2499f9e935bf8f35dc31c41355b10f9f6fd73c | 870 | py | Python | setup.py | sephii/taxi-petzi | 89cf09a704dce21cae3a6e61f972889577b08fd7 | [
"WTFPL"
] | null | null | null | setup.py | sephii/taxi-petzi | 89cf09a704dce21cae3a6e61f972889577b08fd7 | [
"WTFPL"
] | null | null | null | setup.py | sephii/taxi-petzi | 89cf09a704dce21cae3a6e61f972889577b08fd7 | [
"WTFPL"
] | null | null | null | #!/usr/bin/env python
from setuptools import find_packages, setup
from taxi_petzi import __version__
with open("README.md") as f:
readme = f.read()
install_requires = [
"google-api-python-client",
"google-auth-httplib2",
"google-auth-oauthlib",
"taxi>=6.1.0",
]
setup(
name="taxi_petzi",
... | 24.166667 | 67 | 0.670115 |
from setuptools import find_packages, setup
from taxi_petzi import __version__
with open("README.md") as f:
readme = f.read()
install_requires = [
"google-api-python-client",
"google-auth-httplib2",
"google-auth-oauthlib",
"taxi>=6.1.0",
]
setup(
name="taxi_petzi",
version=__version__,
... | true | true |
1c249a40c51424a6df50cb502ba5cbeac9828c60 | 3,638 | py | Python | share/transformers/gov_clinicaltrials.py | CenterForOpenScience/SHARE | c7715af2881f6fa23197d4e7c381d90169a90ed1 | [
"Apache-2.0"
] | 87 | 2015-01-06T18:24:45.000Z | 2021-08-08T07:59:40.000Z | share/transformers/gov_clinicaltrials.py | fortress-biotech/SHARE | 9c5a05dd831447949fa6253afec5225ff8ab5d4f | [
"Apache-2.0"
] | 442 | 2015-01-01T19:16:01.000Z | 2022-03-30T21:10:26.000Z | share/transformers/gov_clinicaltrials.py | fortress-biotech/SHARE | 9c5a05dd831447949fa6253afec5225ff8ab5d4f | [
"Apache-2.0"
] | 67 | 2015-03-10T16:32:58.000Z | 2021-11-12T16:33:41.000Z | from share.transform.chain import *
from share.transform.chain.utils import force_text
class Tag(Parser):
name = ctx
class ThroughTags(Parser):
tag = Delegate(Tag, ctx)
class AgentIdentifier(Parser):
# email address
uri = IRI(ctx)
class WorkIdentifier(Parser):
uri = IRI(ctx)
class Affiliat... | 32.482143 | 115 | 0.695712 | from share.transform.chain import *
from share.transform.chain.utils import force_text
class Tag(Parser):
name = ctx
class ThroughTags(Parser):
tag = Delegate(Tag, ctx)
class AgentIdentifier(Parser):
uri = IRI(ctx)
class WorkIdentifier(Parser):
uri = IRI(ctx)
class AffiliatedAgent(Parser)... | true | true |
1c249a6a03ce5a7f0bc3da3e6773cd19cf43ccf3 | 5,787 | py | Python | src/sage/categories/examples/infinite_enumerated_sets.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | 2 | 2018-06-30T01:37:35.000Z | 2018-06-30T01:37:39.000Z | src/sage/categories/examples/infinite_enumerated_sets.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | null | null | null | src/sage/categories/examples/infinite_enumerated_sets.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | 1 | 2020-07-24T12:20:37.000Z | 2020-07-24T12:20:37.000Z | """
Examples of infinite enumerated sets
"""
#*****************************************************************************
# Copyright (C) 2009 Florent Hivert <Florent.Hivert@univ-rouen.fr>
#
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
#******... | 31.281081 | 84 | 0.555728 |
from sage.structure.parent import Parent
from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets
from sage.structure.unique_representation import UniqueRepresentation
from sage.rings.integer import Integer
class NonNegativeIntegers(UniqueRepresentation, Parent):
def __init__(self):
... | true | true |
1c249aa87a055ec6f83086122acf7989ea5b3ab5 | 30,565 | py | Python | tensorflow/python/keras/layers/wrappers.py | khanhlvg/tensorflow | a59b74ccaafae59d616ecf08204d63023ff6f49c | [
"Apache-2.0"
] | 4 | 2021-02-01T01:01:11.000Z | 2021-07-21T15:22:20.000Z | tensorflow/python/keras/layers/wrappers.py | khanhlvg/tensorflow | a59b74ccaafae59d616ecf08204d63023ff6f49c | [
"Apache-2.0"
] | 8 | 2019-07-08T10:09:18.000Z | 2019-09-26T20:55:43.000Z | tensorflow/python/keras/layers/wrappers.py | khanhlvg/tensorflow | a59b74ccaafae59d616ecf08204d63023ff6f49c | [
"Apache-2.0"
] | 5 | 2020-12-22T10:17:47.000Z | 2021-05-06T14:14:52.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... | 40.699068 | 120 | 0.682938 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
from tensorflow.python.framework import tensor_shape
from tensorflow.python.keras import backend as K
from tensorflow.python.keras.engine import base_layer_utils
from tensorflow.pyth... | true | true |
1c249cc29e067f09479d6196b8dafe74cb750c0b | 2,229 | py | Python | v2/cb_base.py | btflyer/bico | 8fae0c29353b25bab6b377320ce1cbbfa322f444 | [
"MIT"
] | null | null | null | v2/cb_base.py | btflyer/bico | 8fae0c29353b25bab6b377320ce1cbbfa322f444 | [
"MIT"
] | null | null | null | v2/cb_base.py | btflyer/bico | 8fae0c29353b25bab6b377320ce1cbbfa322f444 | [
"MIT"
] | 3 | 2018-12-13T13:44:53.000Z | 2020-01-07T14:54:20.000Z | import simpy
#TO DO:
# - make Cb's discoverable somehow
class CbBase(object):
"""A computational bacterium performs its basic function in a
continuous but periodic fashion (sleep, act).
A bacterium responds to changes in its environmental context
by checking the attributes of the given context.
A... | 34.292308 | 78 | 0.59668 | import simpy
class CbBase(object):
def __init__(self, env, id, context, event_stream, event_kinds, period):
self.env = env
self.id = id
self.ev_kinds = event_kinds
self.context = context
self.events = event_stream
self.event = None
self.period = period
... | true | true |
1c249d46e9ec80f7271d5e8ea791577a995b2c2c | 5,977 | py | Python | tests/pymcell4_positive/0501_cellblender_viz_output_v2/model.py | mcellteam/mcell-tests | 34d2d967b75d56edbae999bf0090641850f4f4fe | [
"MIT"
] | 1 | 2021-08-13T20:40:54.000Z | 2021-08-13T20:40:54.000Z | tests/pymcell4_positive/0501_cellblender_viz_output_v2/model.py | mcellteam/mcell_tests | 34d2d967b75d56edbae999bf0090641850f4f4fe | [
"MIT"
] | null | null | null | tests/pymcell4_positive/0501_cellblender_viz_output_v2/model.py | mcellteam/mcell_tests | 34d2d967b75d56edbae999bf0090641850f4f4fe | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import os
import array
MCELL_PATH = os.environ.get('MCELL_PATH', '')
if MCELL_PATH:
sys.path.append(os.path.join(MCELL_PATH, 'lib'))
else:
print("Error: variable MCELL_PATH that is used to find the mcell library was not set.")
sys.exit(1)
import mcell as m
def read_ce... | 34.154286 | 159 | 0.541576 |
import sys
import os
import array
MCELL_PATH = os.environ.get('MCELL_PATH', '')
if MCELL_PATH:
sys.path.append(os.path.join(MCELL_PATH, 'lib'))
else:
print("Error: variable MCELL_PATH that is used to find the mcell library was not set.")
sys.exit(1)
import mcell as m
def read_cellblender_viz_output(f... | true | true |
1c249dfdb1984e5259e265401c70b545a54d3b54 | 5,332 | py | Python | frappe/migrate.py | oryxsolutions/frappe | d193ea22d17ca40d57432040a8afad72287d9e23 | [
"MIT"
] | null | null | null | frappe/migrate.py | oryxsolutions/frappe | d193ea22d17ca40d57432040a8afad72287d9e23 | [
"MIT"
] | null | null | null | frappe/migrate.py | oryxsolutions/frappe | d193ea22d17ca40d57432040a8afad72287d9e23 | [
"MIT"
] | null | null | null | # Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import json
import os
from textwrap import dedent
import frappe
import frappe.model.sync
import frappe.modules.patch_handler
import frappe.translate
from frappe.cache_manager import clear_global_cache
from frappe.core.doc... | 30.124294 | 105 | 0.767629 |
import json
import os
from textwrap import dedent
import frappe
import frappe.model.sync
import frappe.modules.patch_handler
import frappe.translate
from frappe.cache_manager import clear_global_cache
from frappe.core.doctype.language.language import sync_languages
from frappe.core.doctype.scheduled_job_type.schedu... | true | true |
1c24a0baca3190f3377354af1640b63ea5cc31a0 | 140 | py | Python | tests/ut/test_assets.py | cicheck/dfd | b02752f958cfea2f85222e2b4b3ba7e265a6152d | [
"MIT"
] | null | null | null | tests/ut/test_assets.py | cicheck/dfd | b02752f958cfea2f85222e2b4b3ba7e265a6152d | [
"MIT"
] | 2 | 2021-12-31T17:44:20.000Z | 2021-12-31T19:51:11.000Z | tests/ut/test_assets.py | cicheck/dfd | b02752f958cfea2f85222e2b4b3ba7e265a6152d | [
"MIT"
] | null | null | null | import dlib
from dfd import assets
def test_face_landmarks_model_loads():
dlib.shape_predictor(str(assets.FACE_LANDMARKS_MODEL_PATH)) | 20 | 63 | 0.828571 | import dlib
from dfd import assets
def test_face_landmarks_model_loads():
dlib.shape_predictor(str(assets.FACE_LANDMARKS_MODEL_PATH)) | true | true |
1c24a1d54d8435fce427b7e0f8ce587b52b164f9 | 2,637 | py | Python | pygsp/graphs/randomring.py | jafluri/pygsp | ff8c0023c25df4cbcfd88a7ef63c6223f3030a51 | [
"BSD-3-Clause"
] | 1 | 2021-06-14T20:32:54.000Z | 2021-06-14T20:32:54.000Z | pygsp/graphs/randomring.py | jafluri/pygsp | ff8c0023c25df4cbcfd88a7ef63c6223f3030a51 | [
"BSD-3-Clause"
] | null | null | null | pygsp/graphs/randomring.py | jafluri/pygsp | ff8c0023c25df4cbcfd88a7ef63c6223f3030a51 | [
"BSD-3-Clause"
] | 2 | 2020-06-20T17:05:48.000Z | 2022-02-11T10:14:52.000Z | # -*- coding: utf-8 -*-
import numpy as np
from scipy import sparse
from pygsp import utils
from . import Graph # prevent circular import in Python < 3.5
class RandomRing(Graph):
r"""Ring graph with randomly sampled vertices.
Parameters
----------
N : int
Number of vertices.
angles : a... | 32.158537 | 79 | 0.562761 |
import numpy as np
from scipy import sparse
from pygsp import utils
from . import Graph
class RandomRing(Graph):
def __init__(self, N=64, angles=None, seed=None, **kwargs):
self.seed = seed
if angles is None:
rs = np.random.RandomState(seed)
angles = np.sort(rs.unif... | true | true |
1c24a272c041811a0b3dc7e870ffe8df5997aa22 | 21 | py | Python | app/chats/forms.py | woooo-code/site | a12e8c3895df9651dfb97a79adf36d58cdc50eb7 | [
"PostgreSQL"
] | null | null | null | app/chats/forms.py | woooo-code/site | a12e8c3895df9651dfb97a79adf36d58cdc50eb7 | [
"PostgreSQL"
] | 2 | 2021-03-31T19:37:20.000Z | 2021-12-13T20:35:29.000Z | app/chats/forms.py | woooo-code/site | a12e8c3895df9651dfb97a79adf36d58cdc50eb7 | [
"PostgreSQL"
] | null | null | null | # app/chats/forms.py
| 10.5 | 20 | 0.714286 | true | true | |
1c24a2e5d38aa21cf64d668943c8c6542caf9054 | 89 | py | Python | src/common/constants.py | kanmaytacker/heart-net | 076563ddd05f0fb94ddb552f7e8952b67fd060e0 | [
"MIT"
] | null | null | null | src/common/constants.py | kanmaytacker/heart-net | 076563ddd05f0fb94ddb552f7e8952b67fd060e0 | [
"MIT"
] | null | null | null | src/common/constants.py | kanmaytacker/heart-net | 076563ddd05f0fb94ddb552f7e8952b67fd060e0 | [
"MIT"
] | null | null | null | XSUB_PERSONS = [1, 2, 4, 5, 8, 9, 13, 14, 15, 16, 17, 18, 19, 25, 27, 28, 31, 34, 35, 38] | 89 | 89 | 0.516854 | XSUB_PERSONS = [1, 2, 4, 5, 8, 9, 13, 14, 15, 16, 17, 18, 19, 25, 27, 28, 31, 34, 35, 38] | true | true |
1c24a30f39aa3525d46b77e290da3992b7d564fd | 5,550 | py | Python | include/HydrusEncryption.py | DonaldTsang/hydrus | 1ffd13469c0ea98ea78961ab377aff1c6325379b | [
"WTFPL"
] | 3 | 2019-06-19T09:29:50.000Z | 2019-12-18T14:17:21.000Z | include/HydrusEncryption.py | DonaldTsang/hydrus | 1ffd13469c0ea98ea78961ab377aff1c6325379b | [
"WTFPL"
] | 50 | 2019-04-05T02:25:13.000Z | 2019-04-27T04:29:31.000Z | include/HydrusEncryption.py | DonaldTsang/hydrus | 1ffd13469c0ea98ea78961ab377aff1c6325379b | [
"WTFPL"
] | null | null | null | from . import HydrusConstants as HC
import OpenSSL
import os
import stat
import traceback
def GenerateOpenSSLCertAndKeyFile( cert_path, key_path ):
key = OpenSSL.crypto.PKey()
key.generate_key( OpenSSL.crypto.TYPE_RSA, 2048 )
# create a self-signed cert
cert = OpenSSL.crypto.X509()
... | 23.617021 | 92 | 0.608829 | from . import HydrusConstants as HC
import OpenSSL
import os
import stat
import traceback
def GenerateOpenSSLCertAndKeyFile( cert_path, key_path ):
key = OpenSSL.crypto.PKey()
key.generate_key( OpenSSL.crypto.TYPE_RSA, 2048 )
cert = OpenSSL.crypto.X509()
cert.get_subject().coun... | true | true |
1c24a33096cf6515ba408f8a6ddcbfaa928fa172 | 4,654 | py | Python | train.py | kuc2477/pytorch-wgan-gp | 0a1e8bd719577ffd7061059fcf26bc61fe2bd076 | [
"MIT"
] | 23 | 2017-10-31T18:44:39.000Z | 2021-04-29T02:55:13.000Z | train.py | kuc2477/pytorch-wgan-gp | 0a1e8bd719577ffd7061059fcf26bc61fe2bd076 | [
"MIT"
] | 3 | 2018-02-15T19:34:57.000Z | 2021-07-17T09:35:32.000Z | train.py | kuc2477/pytorch-wgan-gp | 0a1e8bd719577ffd7061059fcf26bc61fe2bd076 | [
"MIT"
] | 8 | 2018-03-29T03:45:43.000Z | 2021-11-19T11:06:54.000Z | from torch import optim
from torch.autograd import Variable
from tqdm import tqdm
import utils
import visual
def train(model, dataset, collate_fn=None,
lr=1e-04, weight_decay=1e-04, beta1=0.5, beta2=.999, lamda=10.,
batch_size=32, sample_size=32, epochs=10,
d_trains_per_g_train=2,
... | 34.474074 | 78 | 0.515041 | from torch import optim
from torch.autograd import Variable
from tqdm import tqdm
import utils
import visual
def train(model, dataset, collate_fn=None,
lr=1e-04, weight_decay=1e-04, beta1=0.5, beta2=.999, lamda=10.,
batch_size=32, sample_size=32, epochs=10,
d_trains_per_g_train=2,
... | true | true |
1c24a35d79c87208fdf30be59328d4b622c98ae3 | 1,071 | py | Python | SequenceGroup.py | MikeCurrington/LedPinky | 48faf62f13fbf4bfe05a71628fda3f597db21d0c | [
"MIT"
] | null | null | null | SequenceGroup.py | MikeCurrington/LedPinky | 48faf62f13fbf4bfe05a71628fda3f597db21d0c | [
"MIT"
] | null | null | null | SequenceGroup.py | MikeCurrington/LedPinky | 48faf62f13fbf4bfe05a71628fda3f597db21d0c | [
"MIT"
] | null | null | null | import time
from SequenceBase import SequenceBase
class SequenceGroup( SequenceBase ):
def __init__(self):
super(SequenceGroup, self).__init__([])
self.children = []
self.pinsChanged = []
self.delay = 0.05
def Add(self, sequence):
self.children.append(sequence)
def Restart(self):
self.... | 23.282609 | 46 | 0.6676 | import time
from SequenceBase import SequenceBase
class SequenceGroup( SequenceBase ):
def __init__(self):
super(SequenceGroup, self).__init__([])
self.children = []
self.pinsChanged = []
self.delay = 0.05
def Add(self, sequence):
self.children.append(sequence)
def Restart(self):
self.... | true | true |
1c24a392802d1917e1485fd1199b848d0e890366 | 164 | py | Python | kanji_lists/__init__.py | ffe4/kanji-lists | d8eafa9ed0cc4766ee1d9a094c3f25fba851063c | [
"MIT"
] | 5 | 2021-04-10T19:28:18.000Z | 2022-02-17T17:40:54.000Z | kanji_lists/__init__.py | ffe4/kanji-lists | d8eafa9ed0cc4766ee1d9a094c3f25fba851063c | [
"MIT"
] | 2 | 2021-05-23T20:26:19.000Z | 2021-05-24T12:55:41.000Z | kanji_lists/__init__.py | ffe4/kanji-lists | d8eafa9ed0cc4766ee1d9a094c3f25fba851063c | [
"MIT"
] | null | null | null | """This module has been automatically generated. Do not edit manually!"""
from kanji_lists.kanji_lists import JINMEIYO, JLPT, JOYO, KYOIKU
__version__ = "0.1.0"
| 23.428571 | 73 | 0.756098 |
from kanji_lists.kanji_lists import JINMEIYO, JLPT, JOYO, KYOIKU
__version__ = "0.1.0"
| true | true |
1c24a3e1e1404aed1bf6dc592baa39e22f9148b1 | 1,704 | py | Python | algos/clustered_sbl.py | Amdis23/Tapestry_Intial | 7924380692df59fed3c3b982a2de0558cac3a419 | [
"Apache-2.0"
] | null | null | null | algos/clustered_sbl.py | Amdis23/Tapestry_Intial | 7924380692df59fed3c3b982a2de0558cac3a419 | [
"Apache-2.0"
] | null | null | null | algos/clustered_sbl.py | Amdis23/Tapestry_Intial | 7924380692df59fed3c3b982a2de0558cac3a419 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=2 expandtab shiftwidth=2 softtabstop=8
# Imports the precise variant of SBL using clustering method instead of
# thresholding
from inbuilt_algos import sbl
import numpy as np
# Use thresholding method 'cluster' for SBL to get very precise results
def clustered_sbl(params):
A = params["A"]
y = par... | 28.881356 | 71 | 0.674883 |
from inbuilt_algos import sbl
import numpy as np
def clustered_sbl(params):
A = params["A"]
y = params["y"]
t = A.shape[0]
n = A.shape[1]
assert t == len(y)
x_est = sbl.sbl(A, y, thresholding_method='cluster')
res = {'x_est' : x_est}
return res
def sbl_multi(params, selection_metho... | true | true |
1c24a4119eb529221707fb35d16a35454d4b7401 | 173 | py | Python | app/database.py | vladimirze/Gimme-JSON-backend | 37fba97fcc99a2e631606f97fc48e6c280775ed0 | [
"MIT"
] | null | null | null | app/database.py | vladimirze/Gimme-JSON-backend | 37fba97fcc99a2e631606f97fc48e6c280775ed0 | [
"MIT"
] | null | null | null | app/database.py | vladimirze/Gimme-JSON-backend | 37fba97fcc99a2e631606f97fc48e6c280775ed0 | [
"MIT"
] | null | null | null | import pymongo
from settings import settings
connection = pymongo.MongoClient(settings.DATABASE_HOST, settings.DATABASE_PORT)
database = connection[settings.MONGODB_NAME]
| 24.714286 | 80 | 0.849711 | import pymongo
from settings import settings
connection = pymongo.MongoClient(settings.DATABASE_HOST, settings.DATABASE_PORT)
database = connection[settings.MONGODB_NAME]
| true | true |
1c24a652c941c680c7b2257e2d51e80cf259f901 | 920 | py | Python | core/src/zeit/content/cp/blocks/cardstack.py | rickdg/vivi | 16134ac954bf8425646d4ad47bdd1f372e089355 | [
"BSD-3-Clause"
] | 5 | 2019-05-16T09:51:29.000Z | 2021-05-31T09:30:03.000Z | core/src/zeit/content/cp/blocks/cardstack.py | rickdg/vivi | 16134ac954bf8425646d4ad47bdd1f372e089355 | [
"BSD-3-Clause"
] | 107 | 2019-05-24T12:19:02.000Z | 2022-03-23T15:05:56.000Z | core/src/zeit/content/cp/blocks/cardstack.py | rickdg/vivi | 16134ac954bf8425646d4ad47bdd1f372e089355 | [
"BSD-3-Clause"
] | 3 | 2020-08-14T11:01:17.000Z | 2022-01-08T17:32:19.000Z | from zeit.cms.content.property import ObjectPathAttributeProperty
from zeit.cms.i18n import MessageFactory as _
from zeit.content.cp.interfaces import ICardstackBlock
import grokcore.component as grok
import zeit.cms.content.property
import zeit.content.cp.blocks.block
import zeit.content.cp.interfaces
@grok.implemen... | 31.724138 | 65 | 0.770652 | from zeit.cms.content.property import ObjectPathAttributeProperty
from zeit.cms.i18n import MessageFactory as _
from zeit.content.cp.interfaces import ICardstackBlock
import grokcore.component as grok
import zeit.cms.content.property
import zeit.content.cp.blocks.block
import zeit.content.cp.interfaces
@grok.implemen... | true | true |
1c24a74ccb184314644bc87f7d8339b860c7d621 | 2,352 | py | Python | test.py | tydcg/pythonlearn | 05da4ad0c81b919a6ca55e0b926af3a01475d861 | [
"Apache-2.0"
] | null | null | null | test.py | tydcg/pythonlearn | 05da4ad0c81b919a6ca55e0b926af3a01475d861 | [
"Apache-2.0"
] | null | null | null | test.py | tydcg/pythonlearn | 05da4ad0c81b919a6ca55e0b926af3a01475d861 | [
"Apache-2.0"
] | null | null | null | import os, csv, re
import pandas as pd
import numpy as np
import scanpy as sc
import math
from scanpy import read_10x_h5
import SpaGCN as spg
from scipy.sparse import issparse
import random, torch
import warnings
import matplotlib.colors as clr
import matplotlib.pyplot as plt
# In order to read in image data, we nee... | 28.337349 | 114 | 0.67517 | import os, csv, re
import pandas as pd
import numpy as np
import scanpy as sc
import math
from scanpy import read_10x_h5
import SpaGCN as spg
from scipy.sparse import issparse
import random, torch
import warnings
import matplotlib.colors as clr
import matplotlib.pyplot as plt
import cv2
path = "/Users/wangtong/D... | true | true |
1c24a8b682d604d644a9b3cb1478c08f4a7c91e2 | 13,603 | py | Python | ml/kubeflow-pipelines/components/dataflow/tft/taxi_preprocess_bq.py | bhjeong-goldenplanet/automl | 0e24ef5d57b005a1185d1a583eff88ee9e45f748 | [
"Apache-2.0"
] | 146 | 2018-02-18T22:57:51.000Z | 2022-02-03T10:27:40.000Z | ml/kubeflow-pipelines/components/dataflow/tft/taxi_preprocess_bq.py | bhjeong-goldenplanet/automl | 0e24ef5d57b005a1185d1a583eff88ee9e45f748 | [
"Apache-2.0"
] | 15 | 2019-02-15T10:05:30.000Z | 2022-02-10T02:37:12.000Z | ml/kubeflow-pipelines/components/dataflow/tft/taxi_preprocess_bq.py | bhjeong-goldenplanet/automl | 0e24ef5d57b005a1185d1a583eff88ee9e45f748 | [
"Apache-2.0"
] | 88 | 2017-08-31T22:58:24.000Z | 2022-02-18T05:30:47.000Z | # Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 36.567204 | 144 | 0.668161 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import datetime
import uuid
import os
import apache_beam as beam
import tensorflow as tf
import tensorflow_transform as transform
from tensorflow.python.lib.io import file_io
f... | true | true |
1c24a8cda0ea294b0e36850bfae9aa36825a7e56 | 2,968 | py | Python | blueoil/cmd/train.py | yasumura-lm/blueoil | 2149f97862e9a0684f816cc27f16d461b8dcc3ad | [
"Apache-2.0"
] | null | null | null | blueoil/cmd/train.py | yasumura-lm/blueoil | 2149f97862e9a0684f816cc27f16d461b8dcc3ad | [
"Apache-2.0"
] | null | null | null | blueoil/cmd/train.py | yasumura-lm/blueoil | 2149f97862e9a0684f816cc27f16d461b8dcc3ad | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil 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
#
# Unles... | 33.348315 | 117 | 0.708895 |
import os
from datetime import datetime
from tensorflow.io import gfile
import yaml
from blueoil.generate_lmnet_config import generate
from executor.train import run as run_train
from lmnet.utils import horovod as horovod_util
def run(blueoil_config_file, experiment_id):
if horovod_util.is_enabl... | true | true |
1c24aa92fd6b1757c8c33546889573aa93adf85b | 52,147 | py | Python | qcodes/dataset/data_set.py | QTransportLabUAM/Qcodes | 3687bd555b74e066b92e02699cfdc044f63bdc85 | [
"MIT"
] | null | null | null | qcodes/dataset/data_set.py | QTransportLabUAM/Qcodes | 3687bd555b74e066b92e02699cfdc044f63bdc85 | [
"MIT"
] | null | null | null | qcodes/dataset/data_set.py | QTransportLabUAM/Qcodes | 3687bd555b74e066b92e02699cfdc044f63bdc85 | [
"MIT"
] | null | null | null | import functools
import importlib
import json
import logging
import os
import time
import uuid
from queue import Empty, Queue
from threading import Thread
from typing import (Any, Callable, Dict, List, Optional, Sequence, Sized,
Tuple, Union, TYPE_CHECKING)
if TYPE_CHECKING:
import pandas as pd... | 39.208271 | 98 | 0.596295 | import functools
import importlib
import json
import logging
import os
import time
import uuid
from queue import Empty, Queue
from threading import Thread
from typing import (Any, Callable, Dict, List, Optional, Sequence, Sized,
Tuple, Union, TYPE_CHECKING)
if TYPE_CHECKING:
import pandas as pd... | true | true |
1c24ab3569002aa0588fb6e7bbb122987b14c5d0 | 5,841 | py | Python | core/plot_rgb.py | cgtuebingen/emca | 560975bddc1b6176fe25029acb13d7806c8ab35b | [
"MIT"
] | 3 | 2021-09-28T12:08:10.000Z | 2022-01-20T18:27:29.000Z | core/plot_rgb.py | cgtuebingen/emca | 560975bddc1b6176fe25029acb13d7806c8ab35b | [
"MIT"
] | 1 | 2021-11-08T12:57:45.000Z | 2021-11-17T13:45:52.000Z | core/plot_rgb.py | cgtuebingen/emca | 560975bddc1b6176fe25029acb13d7806c8ab35b | [
"MIT"
] | 1 | 2022-01-20T18:27:48.000Z | 2022-01-20T18:27:48.000Z | """
MIT License
Copyright (c) 2020 Christoph Kreisl
Copyright (c) 2021 Lukas Ruppert
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... | 43.266667 | 155 | 0.653313 |
import matplotlib.pyplot as plt
import numpy as np
from core.plot_figure_base import FigureBase
from core.highlighter_base import HighlighterBase
import logging
class RGBScatterPlot(FigureBase):
def __init__(self, callback):
figure, axes = plt.subplots(figsize=(5, 5), nrows=3, ncols=2,
... | true | true |
1c24acd282638fd3f3852c70b5dec0e3ccd47396 | 1,956 | py | Python | jobs/restapi/app.py | Parthi10/Pyspark | a7943010f2af768d33051e09979c892c02bf0610 | [
"MIT"
] | 7 | 2019-03-14T04:50:47.000Z | 2020-02-04T14:04:33.000Z | jobs/restapi/app.py | Ranjan90/learn-pyspark | 91152497eb733c3cf53ffa910dc9fc3948b01ad1 | [
"MIT"
] | null | null | null | jobs/restapi/app.py | Ranjan90/learn-pyspark | 91152497eb733c3cf53ffa910dc9fc3948b01ad1 | [
"MIT"
] | 4 | 2019-12-04T18:24:56.000Z | 2022-02-14T15:56:19.000Z | #python3 app.py
#http://127.0.0.1:5000/user/Elvin
from flask import Flask
from flask_restful import Api, Resource, reqparse
app = Flask(__name__)
api = Api(app)
users = [
{
"name": "Nicholas",
"age": 42,
"occupation": "Network Engineer"
},
{
"name": "Elvin",
"age":... | 23.566265 | 75 | 0.507157 |
from flask import Flask
from flask_restful import Api, Resource, reqparse
app = Flask(__name__)
api = Api(app)
users = [
{
"name": "Nicholas",
"age": 42,
"occupation": "Network Engineer"
},
{
"name": "Elvin",
"age": 32,
"occupation": "Doctor"
},
{... | true | true |
1c24ad6d8e85b1cb3fa330bf94b46f5db81da549 | 4,811 | py | Python | test_autofit/non_linear/optimize/test_pyswarms.py | caoxiaoyue/PyAutoFit | 819cd2acc8d4069497a161c3bb6048128e44d828 | [
"MIT"
] | 39 | 2019-01-24T10:45:23.000Z | 2022-03-18T09:37:59.000Z | test_autofit/non_linear/optimize/test_pyswarms.py | caoxiaoyue/PyAutoFit | 819cd2acc8d4069497a161c3bb6048128e44d828 | [
"MIT"
] | 260 | 2018-11-27T12:56:33.000Z | 2022-03-31T16:08:59.000Z | test_autofit/non_linear/optimize/test_pyswarms.py | caoxiaoyue/PyAutoFit | 819cd2acc8d4069497a161c3bb6048128e44d828 | [
"MIT"
] | 13 | 2018-11-30T16:49:05.000Z | 2022-01-21T17:39:29.000Z | from os import path
import pytest
import autofit as af
from autofit.mock.mock_model import MockClassx3
pytestmark = pytest.mark.filterwarnings("ignore::FutureWarning")
class TestPySwarmsGlobalConfig:
def test__loads_from_config_file_correct(self):
pso = af.PySwarmsGlobal(
pri... | 41.119658 | 92 | 0.648306 | from os import path
import pytest
import autofit as af
from autofit.mock.mock_model import MockClassx3
pytestmark = pytest.mark.filterwarnings("ignore::FutureWarning")
class TestPySwarmsGlobalConfig:
def test__loads_from_config_file_correct(self):
pso = af.PySwarmsGlobal(
pri... | true | true |
1c24ae7f70d01292dbf12e5406b79fb1866b46c7 | 4,240 | py | Python | profiles_api/views.py | Alok-2805/profiles-rest-api | 2cb0790d267fda2f459811cbe0b5e4d5c3fe4759 | [
"MIT"
] | null | null | null | profiles_api/views.py | Alok-2805/profiles-rest-api | 2cb0790d267fda2f459811cbe0b5e4d5c3fe4759 | [
"MIT"
] | null | null | null | profiles_api/views.py | Alok-2805/profiles-rest-api | 2cb0790d267fda2f459811cbe0b5e4d5c3fe4759 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from rest_framework import viewsets
from rest_framework.authentication import TokenAuthentication
from rest_framework import filters
from rest_framework.authtoken.... | 36.551724 | 192 | 0.704481 | from django.shortcuts import render
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from rest_framework import viewsets
from rest_framework.authentication import TokenAuthentication
from rest_framework import filters
from rest_framework.authtoken.... | true | true |
1c24af5bbc5f366873990e773f237998802122e0 | 26,067 | py | Python | test/python/squarepants_test/test_junit_report.py | ericzundel/mvn2pants | 59776864939515bc0cae28e1b89944ce55b98b21 | [
"Apache-2.0"
] | 8 | 2015-04-14T22:37:56.000Z | 2021-01-20T19:46:40.000Z | test/python/squarepants_test/test_junit_report.py | ericzundel/mvn2pants | 59776864939515bc0cae28e1b89944ce55b98b21 | [
"Apache-2.0"
] | 1 | 2016-01-13T23:19:14.000Z | 2016-01-22T22:47:48.000Z | test/python/squarepants_test/test_junit_report.py | ericzundel/mvn2pants | 59776864939515bc0cae28e1b89944ce55b98b21 | [
"Apache-2.0"
] | 3 | 2015-12-13T08:35:34.000Z | 2018-08-01T17:44:59.000Z | # Tests for code in squarepants/src/main/python/squarepants/junit_report.py
#
# Run with:
# ./pants test squarepants/src/test/python/squarepants_test:junit_report
from __future__ import unicode_literals
import json
import os
import tempfile
import shutil
import sys
import unittest
from squarepants import junit_report... | 66.667519 | 3,702 | 0.726973 |
from __future__ import unicode_literals
import json
import os
import tempfile
import shutil
import sys
import unittest
from squarepants import junit_report
class TestJUnitReportParse(unittest.TestCase):
def test_all_success(self):
suite = """
<foo>
<testsuite xmlns:xsi="http://www.w3.org/2001/XMLS... | true | true |
1c24b020864393c148d10b17789d12504930f126 | 697 | py | Python | Plotter.py | damirmardanov/figure-generator | 1ed7ee6d423f2d7392e95529336b8f2d35ea65fd | [
"MIT"
] | null | null | null | Plotter.py | damirmardanov/figure-generator | 1ed7ee6d423f2d7392e95529336b8f2d35ea65fd | [
"MIT"
] | null | null | null | Plotter.py | damirmardanov/figure-generator | 1ed7ee6d423f2d7392e95529336b8f2d35ea65fd | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy.random as rnd
class Plotter:
@staticmethod
def plot(figure=None, figures=None, filename='output.png', height=27, width=27):
fig = plt.figure(0, figsize=(height / 102, width / 102), dpi=102)
ax = fig.add_subplot(111, aspect='equal')
if (figur... | 29.041667 | 84 | 0.578192 | import matplotlib.pyplot as plt
import numpy.random as rnd
class Plotter:
@staticmethod
def plot(figure=None, figures=None, filename='output.png', height=27, width=27):
fig = plt.figure(0, figsize=(height / 102, width / 102), dpi=102)
ax = fig.add_subplot(111, aspect='equal')
if (figur... | true | true |
1c24b178fe9c761f36e6bec8865c83129c37e32a | 3,483 | py | Python | beziers/quadraticbezier.py | ismaelharunid/beziers.py | 16cc85876b4eb1829a43c69d67437b3468c52145 | [
"MIT"
] | null | null | null | beziers/quadraticbezier.py | ismaelharunid/beziers.py | 16cc85876b4eb1829a43c69d67437b3468c52145 | [
"MIT"
] | 2 | 2020-05-08T15:46:59.000Z | 2020-05-08T15:59:30.000Z | beziers/quadraticbezier.py | ismaelharunid/beziers-vD20.py | 16cc85876b4eb1829a43c69d67437b3468c52145 | [
"MIT"
] | null | null | null | from beziers.segment import Segment
from beziers.line import Line
from beziers.point import Point
from beziers.utils import quadraticRoots, isclose
from beziers.utils.arclengthmixin import ArcLengthMixin
my_epsilon = 2e-7
class QuadraticBezier(ArcLengthMixin,Segment):
def __init__(self, start, c1,end):
self.poi... | 33.815534 | 108 | 0.576227 | from beziers.segment import Segment
from beziers.line import Line
from beziers.point import Point
from beziers.utils import quadraticRoots, isclose
from beziers.utils.arclengthmixin import ArcLengthMixin
my_epsilon = 2e-7
class QuadraticBezier(ArcLengthMixin,Segment):
def __init__(self, start, c1,end):
self.poi... | true | true |
1c24b389334033ea837b3be504a91647ae403587 | 541 | py | Python | examples/dummy_example.py | exeum/libexchange-python | bd22340056b4748c41f808552c4e4543de03937f | [
"Apache-2.0"
] | null | null | null | examples/dummy_example.py | exeum/libexchange-python | bd22340056b4748c41f808552c4e4543de03937f | [
"Apache-2.0"
] | null | null | null | examples/dummy_example.py | exeum/libexchange-python | bd22340056b4748c41f808552c4e4543de03937f | [
"Apache-2.0"
] | null | null | null | import os
import sys
dir_name, _ = os.path.split(__file__)
sys.path.insert(0, "./%s/.." % dir_name)
from libexchange.types import Provider
from libexchange.providers import get_driver
d_driver = get_driver(Provider.DUMMY)
api_key = "%s_APIKEY" % Provider.DUMMY.upper()
secret_key = "%s_SECRET" % Provider.DUMMY.uppe... | 22.541667 | 61 | 0.728281 | import os
import sys
dir_name, _ = os.path.split(__file__)
sys.path.insert(0, "./%s/.." % dir_name)
from libexchange.types import Provider
from libexchange.providers import get_driver
d_driver = get_driver(Provider.DUMMY)
api_key = "%s_APIKEY" % Provider.DUMMY.upper()
secret_key = "%s_SECRET" % Provider.DUMMY.uppe... | true | true |
1c24b5cd1919d95bf2b14654d5ab0de01eeaad15 | 13,240 | py | Python | tempest/scenario/test_load_balancer_basic.py | vmahuli/tempest | f70319f5eda72b8c8a913ae1002ec531324e4116 | [
"Apache-2.0"
] | null | null | null | tempest/scenario/test_load_balancer_basic.py | vmahuli/tempest | f70319f5eda72b8c8a913ae1002ec531324e4116 | [
"Apache-2.0"
] | null | null | null | tempest/scenario/test_load_balancer_basic.py | vmahuli/tempest | f70319f5eda72b8c8a913ae1002ec531324e4116 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Mirantis.inc
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 40.121212 | 78 | 0.579305 |
import httplib
import tempfile
import time
import urllib2
from tempest.api.network import common as net_common
from tempest.common import commands
from tempest import config
from tempest import exceptions
from tempest.scenario import manager
from tempest import test
config = config.CONF
class TestLo... | true | true |
1c24b753047967f2862d554cdf66ce33718e5ceb | 10,906 | py | Python | plugins/modules/oci_database_autonomous_database_backup_facts.py | hanielburton/oci-ansible-collection | dfdffde637f746d346ba35569be8c3a3407022f2 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_database_autonomous_database_backup_facts.py | hanielburton/oci-ansible-collection | dfdffde637f746d346ba35569be8c3a3407022f2 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_database_autonomous_database_backup_facts.py | hanielburton/oci-ansible-collection | dfdffde637f746d346ba35569be8c3a3407022f2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2017, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 35.640523 | 159 | 0.64139 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: oci_database_autonomous_database_backup_facts
short_description: Fetches det... | true | true |
1c24b815c5dc65b851162c4dd79bcb95c4504eae | 3,373 | py | Python | WeiXinProj/WeiXinProj/settings.py | xingag/weixin_spider | 506c2ceb2025c0035f88017bce578fb0bfcf1362 | [
"Apache-2.0"
] | 30 | 2018-12-14T01:13:29.000Z | 2022-03-09T14:11:57.000Z | WeiXinProj/WeiXinProj/settings.py | xingag/weixin_spider | 506c2ceb2025c0035f88017bce578fb0bfcf1362 | [
"Apache-2.0"
] | null | null | null | WeiXinProj/WeiXinProj/settings.py | xingag/weixin_spider | 506c2ceb2025c0035f88017bce578fb0bfcf1362 | [
"Apache-2.0"
] | 13 | 2019-06-05T01:30:26.000Z | 2020-11-16T20:08:03.000Z | # -*- coding: utf-8 -*-
# Scrapy settings for WinXinProj project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://doc.scrapy.org/en/latest/topics/settings.html
# https://doc.scrapy.org/en/latest/to... | 36.268817 | 142 | 0.768752 |
BOT_NAME = 'WeiXinProj'
SPIDER_MODULES = ['WeiXinProj.spiders']
NEWSPIDER_MODULE = 'WeiXinProj.spiders'
USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36'
ROBOTSTXT_OBEY = False
Y = 3
DOW... | true | true |
1c24b81a4a17cbdab0e7032899dd7b81df816cbe | 1,650 | py | Python | app/api/routers/items.py | flych3r/spotify-tracker | 306d549da6a57866ea480c85286d870e7653a1eb | [
"MIT"
] | 2 | 2021-06-25T00:24:13.000Z | 2021-07-10T13:00:39.000Z | app/api/routers/items.py | flych3r/spotify-tracker | 306d549da6a57866ea480c85286d870e7653a1eb | [
"MIT"
] | null | null | null | app/api/routers/items.py | flych3r/spotify-tracker | 306d549da6a57866ea480c85286d870e7653a1eb | [
"MIT"
] | 2 | 2021-05-16T01:40:39.000Z | 2021-07-10T12:59:07.000Z | from typing import Dict, List, Union
from fastapi import APIRouter, Query, Security
from app.api.crud.played_tracks import (
get_artists,
get_audio_features,
get_genres,
get_tracks,
)
from app.api.dependencies.config import AUDIO_FEATURES
from app.api.dependencies.security import get_current_user
from... | 29.464286 | 87 | 0.712727 | from typing import Dict, List, Union
from fastapi import APIRouter, Query, Security
from app.api.crud.played_tracks import (
get_artists,
get_audio_features,
get_genres,
get_tracks,
)
from app.api.dependencies.config import AUDIO_FEATURES
from app.api.dependencies.security import get_current_user
from... | true | true |
1c24b83ea9d6cd0a7c5ac91a4ae8af09f41e347d | 188 | py | Python | conbench/tests/test_version.py | jonkeane/conbench | f096cc2f8b7a85d8e9aea32d8310127cf1923212 | [
"MIT"
] | 48 | 2020-03-02T16:55:46.000Z | 2022-02-26T00:35:57.000Z | conbench/tests/test_version.py | jonkeane/conbench | f096cc2f8b7a85d8e9aea32d8310127cf1923212 | [
"MIT"
] | 103 | 2020-03-23T00:22:46.000Z | 2022-03-31T22:34:40.000Z | conbench/tests/test_version.py | jonkeane/conbench | f096cc2f8b7a85d8e9aea32d8310127cf1923212 | [
"MIT"
] | 6 | 2020-03-04T17:52:35.000Z | 2022-03-30T11:53:40.000Z | import importlib.metadata as importlib_metadata
import conbench
__version__ = importlib_metadata.version("conbench")
def test_version():
assert __version__ == conbench.__version__
| 18.8 | 52 | 0.808511 | import importlib.metadata as importlib_metadata
import conbench
__version__ = importlib_metadata.version("conbench")
def test_version():
assert __version__ == conbench.__version__
| true | true |
1c24b8c52ebf2eedfd11fdeaed970c6a138ce4be | 1,317 | py | Python | libsm/sm/__init__.py | libsm/libsm | 0c463c7d733d1a5bf6f4f19da49dd2a1f69f8cf5 | [
"MIT"
] | null | null | null | libsm/sm/__init__.py | libsm/libsm | 0c463c7d733d1a5bf6f4f19da49dd2a1f69f8cf5 | [
"MIT"
] | null | null | null | libsm/sm/__init__.py | libsm/libsm | 0c463c7d733d1a5bf6f4f19da49dd2a1f69f8cf5 | [
"MIT"
] | null | null | null | import logging
from ..val import Val
from ..std.pair import Type as Pair
class SM:
def __init__(self, fi, fn, logger=None):
self.logger = logging.getLogger(name=logger)
self.__V = set()
self.__E = set()
N = set()
try:
self.logger.info('[SM] [INIT] [START]')
... | 22.322034 | 52 | 0.441913 | import logging
from ..val import Val
from ..std.pair import Type as Pair
class SM:
def __init__(self, fi, fn, logger=None):
self.logger = logging.getLogger(name=logger)
self.__V = set()
self.__E = set()
N = set()
try:
self.logger.info('[SM] [INIT] [START]')
... | true | true |
1c24b91bc797e5b8ed6c9525029f5ed25248e75e | 4,345 | py | Python | m2c/mongoexport_pk_analyze.py | pdooner/azure-cosmos-db-mongo-migration | 35e0e2f606c27fdd681c57095aac1038f12ce88e | [
"MIT"
] | 1 | 2021-11-02T19:09:10.000Z | 2021-11-02T19:09:10.000Z | m2c/mongoexport_pk_analyze.py | pdooner/azure-cosmos-db-mongo-migration | 35e0e2f606c27fdd681c57095aac1038f12ce88e | [
"MIT"
] | null | null | null | m2c/mongoexport_pk_analyze.py | pdooner/azure-cosmos-db-mongo-migration | 35e0e2f606c27fdd681c57095aac1038f12ce88e | [
"MIT"
] | 3 | 2021-11-03T13:08:56.000Z | 2022-02-10T08:20:38.000Z |
"""
Usage:
python mongoexport_analyze.py hello_matplotlib
---
source env.sh
export infile=$M2C_APP_DATA_DIR/mongoexports/openflights/openflights__routes.json
python mongoexport_pk_analyze.py pk_analysis $infile
"""
__author__ = 'Chris Joakim'
__email__ = "chjoakim@microsoft.com"
__license__ =... | 32.916667 | 102 | 0.628078 |
__author__ = 'Chris Joakim'
__email__ = "chjoakim@microsoft.com"
__license__ = "MIT"
__version__ = "October 2021"
import os
import sys
import time
import traceback
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from docopt import docopt
plt.style.use('cla... | true | true |
1c24b92b3bd54a520e3e5818408b745daf73d107 | 355 | py | Python | td3a_cpp_deep/__init__.py | sdpython/td3a_cpp_deep | bb8b82113bf482fb681e30b415294b29f60d6505 | [
"MIT"
] | null | null | null | td3a_cpp_deep/__init__.py | sdpython/td3a_cpp_deep | bb8b82113bf482fb681e30b415294b29f60d6505 | [
"MIT"
] | null | null | null | td3a_cpp_deep/__init__.py | sdpython/td3a_cpp_deep | bb8b82113bf482fb681e30b415294b29f60d6505 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Template to develop a python module using
:epkg:`torch`.
"""
__version__ = "0.1.0"
__author__ = "Xavier Dupré"
def check(verbose=1):
"""
Runs a couple of functions to check the module is working.
:param verbose: 0 to hide the standout output
:return: list of dictionaries, result ... | 18.684211 | 62 | 0.659155 |
__version__ = "0.1.0"
__author__ = "Xavier Dupré"
def check(verbose=1):
return []
| true | true |
1c24b987b4b254cc23ff8364cf61bf1c532cac69 | 12,602 | py | Python | djcelery/tests/test_schedulers.py | doctoryes/django-celery | 756cb57aad765cb2b0d37372c1855b8f5f37e6b0 | [
"BSD-3-Clause"
] | null | null | null | djcelery/tests/test_schedulers.py | doctoryes/django-celery | 756cb57aad765cb2b0d37372c1855b8f5f37e6b0 | [
"BSD-3-Clause"
] | 1 | 2017-08-04T15:56:01.000Z | 2017-08-04T15:56:01.000Z | djcelery/tests/test_schedulers.py | doctoryes/django-celery | 756cb57aad765cb2b0d37372c1855b8f5f37e6b0 | [
"BSD-3-Clause"
] | 1 | 2021-04-08T15:57:53.000Z | 2021-04-08T15:57:53.000Z | from __future__ import absolute_import, unicode_literals
from datetime import datetime, timedelta
from itertools import count
from celery.five import monotonic
from celery.schedules import schedule, crontab
from djcelery import schedulers
from djcelery import celery
from djcelery.app import app
from djcelery.models ... | 37.505952 | 79 | 0.608951 | from __future__ import absolute_import, unicode_literals
from datetime import datetime, timedelta
from itertools import count
from celery.five import monotonic
from celery.schedules import schedule, crontab
from djcelery import schedulers
from djcelery import celery
from djcelery.app import app
from djcelery.models ... | true | true |
1c24ba130549724790f169fb017f619d5babaf1a | 4,681 | py | Python | lib/deckard/src/ptgen/java/mainj.py | mir597/ml_safe | e0da1d9c564b0e8850e75db1d3d976b959bf61cb | [
"BSD-3-Clause"
] | 2 | 2018-10-07T21:28:29.000Z | 2020-11-11T12:09:30.000Z | lib/deckard/src/ptgen/java/mainj.py | mir597/ml_safe | e0da1d9c564b0e8850e75db1d3d976b959bf61cb | [
"BSD-3-Clause"
] | null | null | null | lib/deckard/src/ptgen/java/mainj.py | mir597/ml_safe | e0da1d9c564b0e8850e75db1d3d976b959bf61cb | [
"BSD-3-Clause"
] | 3 | 2020-10-21T10:50:23.000Z | 2021-12-27T21:34:50.000Z | #! /usr/bin/env python
#
#
# Copyright (c) 2007-2012,
# Lingxiao Jiang <lxjiang@ucdavis.edu>
# Ghassan Misherghi <ghassanm@ucdavis.edu>
# Zhendong Su <su@ucdavis.edu>
# Stephane Glondu <steph@glondu.net>
# All rights reserved.
#
# Redistribution and use in source and binary for... | 24.898936 | 160 | 0.628285 |
ys
sys.path.append('..')
import YaccParser,YaccLexer
if len(sys.argv) != 2:
print >> sys.stderr, "usage %s grammar"%sys.argv[0]
sys.exit(1)
grammar= open(sys.argv[1],'r')
y= YaccParser.Parser(YaccLexer.Lexer(grammar))
y.grammar()
grammar.close()
outg= open('pt_'+sys.ar... | true | true |
1c24badb5ac35bfaead16b90e11211431a0bcbd6 | 1,558 | py | Python | l_07_strings_files_regex/regex/ex_13_commits.py | VasAtanasov/SoftUni-Python-Fundamentals | 471d0537dd6e5c8b61ede92b7673c0d67e2964fd | [
"MIT"
] | 1 | 2019-06-05T11:16:08.000Z | 2019-06-05T11:16:08.000Z | l_07_strings_files_regex/regex/ex_13_commits.py | VasAtanasov/SoftUni-Python-Fundamentals | 471d0537dd6e5c8b61ede92b7673c0d67e2964fd | [
"MIT"
] | null | null | null | l_07_strings_files_regex/regex/ex_13_commits.py | VasAtanasov/SoftUni-Python-Fundamentals | 471d0537dd6e5c8b61ede92b7673c0d67e2964fd | [
"MIT"
] | null | null | null | import re
PATTERN = r"^https://github\.com/(?P<user>[A-Za-z0-9-]+)/(?P<repo>[A-Za-z_-]+)/" \
r"commit/(?P<hash>[0-9A-Fa-f]{40}),(?P<message>[^\n]+),(?P<additions>[0-9]+),(?P<deletions>[0-9]+)$"
users = {}
while True:
input_line = input()
if input_line == "git push":
break
match = re.fu... | 27.821429 | 110 | 0.575738 | import re
PATTERN = r"^https://github\.com/(?P<user>[A-Za-z0-9-]+)/(?P<repo>[A-Za-z_-]+)/" \
r"commit/(?P<hash>[0-9A-Fa-f]{40}),(?P<message>[^\n]+),(?P<additions>[0-9]+),(?P<deletions>[0-9]+)$"
users = {}
while True:
input_line = input()
if input_line == "git push":
break
match = re.fu... | true | true |
1c24bb6e66114cb48bac1ac8ffa36e0faedd33b8 | 4,122 | py | Python | DQMOffline/CalibMuon/test/DTtTrigDBValidation_TEMPL_cfg.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | DQMOffline/CalibMuon/test/DTtTrigDBValidation_TEMPL_cfg.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | DQMOffline/CalibMuon/test/DTtTrigDBValidation_TEMPL_cfg.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | import FWCore.ParameterSet.Config as cms
process = cms.Process("CALIB")
process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
process.load("Geometry.DTGeometry.dtGeometry_cfi")
process.DTGeometryESModule.applyAlignment = False
process.load("Geometry.MuonNumbering.muonNumberingInitialization_cfi")
proces... | 38.523364 | 153 | 0.681708 | import FWCore.ParameterSet.Config as cms
process = cms.Process("CALIB")
process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
process.load("Geometry.DTGeometry.dtGeometry_cfi")
process.DTGeometryESModule.applyAlignment = False
process.load("Geometry.MuonNumbering.muonNumberingInitialization_cfi")
proces... | true | true |
1c24bc45d0400263f20a7a02a39157c142d2ebbc | 11,315 | py | Python | src/sagemaker/sklearn/model.py | iasoon/sagemaker-python-sdk | 71b39dfb158e3867aad17dbd8be4c3c430e589c0 | [
"Apache-2.0"
] | null | null | null | src/sagemaker/sklearn/model.py | iasoon/sagemaker-python-sdk | 71b39dfb158e3867aad17dbd8be4c3c430e589c0 | [
"Apache-2.0"
] | null | null | null | src/sagemaker/sklearn/model.py | iasoon/sagemaker-python-sdk | 71b39dfb158e3867aad17dbd8be4c3c430e589c0 | [
"Apache-2.0"
] | null | null | null | # Copyright 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" file accompan... | 43.187023 | 98 | 0.64852 |
from __future__ import absolute_import
import logging
import sagemaker
from sagemaker import image_uris
from sagemaker.deserializers import NumpyDeserializer
from sagemaker.fw_utils import model_code_key_prefix, validate_version_or_image_args
from sagemaker.model import FrameworkModel, MODEL_SERVER_WORKER... | true | true |
1c24bc470792e3ef1e5a0916e616d6817e53aeb7 | 9,018 | py | Python | sygnal/helper/proxy/connectproxyclient_twisted.py | kibablu/sygnal | 4f4d7ce014d680a9336bc0723014c40f87393b91 | [
"Apache-2.0"
] | null | null | null | sygnal/helper/proxy/connectproxyclient_twisted.py | kibablu/sygnal | 4f4d7ce014d680a9336bc0723014c40f87393b91 | [
"Apache-2.0"
] | null | null | null | sygnal/helper/proxy/connectproxyclient_twisted.py | kibablu/sygnal | 4f4d7ce014d680a9336bc0723014c40f87393b91 | [
"Apache-2.0"
] | 1 | 2022-03-29T21:47:52.000Z | 2022-03-29T21:47:52.000Z | # -*- coding: utf-8 -*-
# Copyright 2019-2020 The Matrix.org Foundation C.I.C.
#
# 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 re... | 36.658537 | 120 | 0.690841 |
import logging
from base64 import urlsafe_b64encode
from typing import Optional, Tuple
from twisted.internet import defer, protocol
from twisted.internet.base import ReactorBase
from twisted.internet.defer import Deferred
from twisted.internet.interfaces import IProtocolFactory, IStreamClientEndpoint... | true | true |
1c24bca09e6016669a89a6cac3d8719ffb93d2e1 | 2,550 | py | Python | lite/tests/unittest_py/pass/backends/opencl/test_greater_than_cast_fuse_pass.py | kasyoukin/Paddle-Lite | 1de171ecd7de60ea2ad7f507644349389057cdc4 | [
"Apache-2.0"
] | null | null | null | lite/tests/unittest_py/pass/backends/opencl/test_greater_than_cast_fuse_pass.py | kasyoukin/Paddle-Lite | 1de171ecd7de60ea2ad7f507644349389057cdc4 | [
"Apache-2.0"
] | null | null | null | lite/tests/unittest_py/pass/backends/opencl/test_greater_than_cast_fuse_pass.py | kasyoukin/Paddle-Lite | 1de171ecd7de60ea2ad7f507644349389057cdc4 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 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... | 45.535714 | 125 | 0.696078 |
import sys
sys.path.append('../../common')
sys.path.append('../../../')
import test_greater_than_cast_fuse_pass_base
from auto_scan_test_rpc import FusePassAutoScanTest
from program_config import TensorConfig, ProgramConfig, OpConfig, CxxConfig, TargetType, PrecisionType, DataLayoutType, Place
import uni... | true | true |
1c24bdfa62f8b0b4c4d046690c14a9eb765ebc56 | 3,002 | py | Python | com/yoclabo/alfresco/query/Query.py | YuhichYOC/Alfresco-browser | 84daa0f66de2b4b511795e0b7261ad9680e31939 | [
"Apache-2.0"
] | null | null | null | com/yoclabo/alfresco/query/Query.py | YuhichYOC/Alfresco-browser | 84daa0f66de2b4b511795e0b7261ad9680e31939 | [
"Apache-2.0"
] | null | null | null | com/yoclabo/alfresco/query/Query.py | YuhichYOC/Alfresco-browser | 84daa0f66de2b4b511795e0b7261ad9680e31939 | [
"Apache-2.0"
] | null | null | null | #
# Query.py
#
# Copyright 2021 Yuichi Yoshii
# 吉井雄一 @ 吉井産業 you.65535.kir@gmail.com
#
# 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
#
#... | 27.045045 | 105 | 0.651233 |
import base64
import json
import urllib.request
from com.yoclabo.setting import server
class Query:
def __init__(self):
self.f_server_name = server.get_alfresco_url()
self.f_ticket = ''
self.f_url = ''
self.f_node_id = ''
self.f_skip_count = 0
@pro... | true | true |
1c24be77b9423e1d70f796470b9386a8fb74f098 | 10,249 | py | Python | external/model-preparation-algorithm/mpa_tasks/apis/task.py | opencv/openvino_training_extensions | f5d809741e192a2345558efc75899a475019cf98 | [
"Apache-2.0"
] | 775 | 2019-03-01T02:13:33.000Z | 2020-09-07T22:49:15.000Z | external/model-preparation-algorithm/mpa_tasks/apis/task.py | opencv/openvino_training_extensions | f5d809741e192a2345558efc75899a475019cf98 | [
"Apache-2.0"
] | 229 | 2019-02-28T21:37:08.000Z | 2020-09-07T15:11:49.000Z | external/model-preparation-algorithm/mpa_tasks/apis/task.py | opencv/openvino_training_extensions | f5d809741e192a2345558efc75899a475019cf98 | [
"Apache-2.0"
] | 290 | 2019-02-28T20:32:11.000Z | 2020-09-07T05:51:41.000Z | # Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
import abc
import io
import os
import shutil
import tempfile
from typing import Optional, Union
import numpy as np
import torch
from mmcv.utils.config import Config, ConfigDict
from mpa.builder import build
from mpa.modules.hooks.cancel_int... | 38.969582 | 114 | 0.67109 |
import abc
import io
import os
import shutil
import tempfile
from typing import Optional, Union
import numpy as np
import torch
from mmcv.utils.config import Config, ConfigDict
from mpa.builder import build
from mpa.modules.hooks.cancel_interface_hook import CancelInterfaceHook
from mpa.stage import Stage
from mpa.... | true | true |
1c24bef2669301f69daab4de22b750c2f0f3315b | 7,003 | py | Python | dmc2gym/wrappers.py | huy-ha/dreamer-pytorch | 98561a5fe4ee5323b955f5fc79bbebf483f08d58 | [
"MIT"
] | null | null | null | dmc2gym/wrappers.py | huy-ha/dreamer-pytorch | 98561a5fe4ee5323b955f5fc79bbebf483f08d58 | [
"MIT"
] | null | null | null | dmc2gym/wrappers.py | huy-ha/dreamer-pytorch | 98561a5fe4ee5323b955f5fc79bbebf483f08d58 | [
"MIT"
] | null | null | null | from gym import spaces, core
import glob
import os
import local_dm_control_suite as suite
from dm_env import specs
import numpy as np
import skimage.io
from rlpyt.envs.base import Env, EnvStep
from dmc2gym import natural_imgsource
def _spec_to_box(spec):
def extract_min_max(s):
assert s.dtype == np.float6... | 33.668269 | 102 | 0.589033 | from gym import spaces, core
import glob
import os
import local_dm_control_suite as suite
from dm_env import specs
import numpy as np
import skimage.io
from rlpyt.envs.base import Env, EnvStep
from dmc2gym import natural_imgsource
def _spec_to_box(spec):
def extract_min_max(s):
assert s.dtype == np.float6... | true | true |
1c24bfb60ff16ea637793072b966dd2a5d05e2eb | 2,888 | py | Python | examples/11_sound/03-sequencer.py | pepsipepsi/nodebox_opengl_python3 | cfb2633df1055a028672b11311603cc2241a1378 | [
"BSD-3-Clause"
] | 1 | 2017-03-19T16:56:46.000Z | 2017-03-19T16:56:46.000Z | examples/11_sound/03-sequencer.py | pepsipepsi/nodebox_opengl_python3 | cfb2633df1055a028672b11311603cc2241a1378 | [
"BSD-3-Clause"
] | null | null | null | examples/11_sound/03-sequencer.py | pepsipepsi/nodebox_opengl_python3 | cfb2633df1055a028672b11311603cc2241a1378 | [
"BSD-3-Clause"
] | null | null | null | import os, sys
sys.path.insert(0, os.path.join("..",".."))
from nodebox.graphics.context import *
from nodebox.graphics import *
from nodebox.sound import PD
from math import sin, pow
# An evolutionary melody.
# The audio tones are generated in Pd, based on data sent from the canvas.
# If you open th... | 29.171717 | 93 | 0.549169 | import os, sys
sys.path.insert(0, os.path.join("..",".."))
from nodebox.graphics.context import *
from nodebox.graphics import *
from nodebox.sound import PD
from math import sin, pow
pd = PD("03-sequencer.pd", start=True)
PIANO = [34, 36, 38, 41, 43, 46, 48, 50]
class Note:
def __init... | true | true |
1c24c0cbbf8edda0dc7c9092a683eabf708dfe94 | 5,727 | py | Python | conans/test/integration/version_check_test.py | amatoshka/conan | c2726e8c255adb120b5f7bdee9e3ec0bc90f1d7a | [
"MIT"
] | null | null | null | conans/test/integration/version_check_test.py | amatoshka/conan | c2726e8c255adb120b5f7bdee9e3ec0bc90f1d7a | [
"MIT"
] | 2 | 2018-02-22T21:28:04.000Z | 2018-09-28T13:51:47.000Z | conans/test/integration/version_check_test.py | amatoshka/conan | c2726e8c255adb120b5f7bdee9e3ec0bc90f1d7a | [
"MIT"
] | null | null | null | import unittest
from collections import OrderedDict
from conans.model.version import Version
from conans.test.utils.cpp_test_files import cpp_hello_conan_files
from conans.test.utils.tools import TestClient, TestServer
class VersionCheckTest(unittest.TestCase):
def check_versions_test(self):
# Client de... | 52.541284 | 98 | 0.600664 | import unittest
from collections import OrderedDict
from conans.model.version import Version
from conans.test.utils.cpp_test_files import cpp_hello_conan_files
from conans.test.utils.tools import TestClient, TestServer
class VersionCheckTest(unittest.TestCase):
def check_versions_test(self):
se... | true | true |
1c24c107b053a00d0fc4b5f3cce366934351f9ae | 2,037 | py | Python | Lib/objc/_DataAccessExpress.py | kanishpatel/Pyto | feec7a1a54f635a6375fa7ede074ff35afbfbb95 | [
"MIT"
] | null | null | null | Lib/objc/_DataAccessExpress.py | kanishpatel/Pyto | feec7a1a54f635a6375fa7ede074ff35afbfbb95 | [
"MIT"
] | null | null | null | Lib/objc/_DataAccessExpress.py | kanishpatel/Pyto | feec7a1a54f635a6375fa7ede074ff35afbfbb95 | [
"MIT"
] | null | null | null | '''
Classes from the 'DataAccessExpress' framework.
'''
try:
from rubicon.objc import ObjCClass
except ValueError:
def ObjCClass(name):
return None
def _Class(name):
try:
return ObjCClass(name)
except NameError:
return None
DABehaviorOptions = _Class('DABehaviorOptions')... | 41.571429 | 95 | 0.83407 |
try:
from rubicon.objc import ObjCClass
except ValueError:
def ObjCClass(name):
return None
def _Class(name):
try:
return ObjCClass(name)
except NameError:
return None
DABehaviorOptions = _Class('DABehaviorOptions')
DAEUpdateGrantedDelegatePermissionContext = _Class('DAE... | true | true |
1c24c14177e17f93b56babb342de05e184c918dc | 5,802 | py | Python | tools/dev/characterize.py | gbalke/bldc-controller | 99e4e71d5bdc0c7c7901d886aa7709c66db8b718 | [
"MIT"
] | null | null | null | tools/dev/characterize.py | gbalke/bldc-controller | 99e4e71d5bdc0c7c7901d886aa7709c66db8b718 | [
"MIT"
] | null | null | null | tools/dev/characterize.py | gbalke/bldc-controller | 99e4e71d5bdc0c7c7901d886aa7709c66db8b718 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import division
from comms import *
import serial
import sys
import time
import pickle
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from scipy.integrate import odeint
PWM_DUTY_CYCLE = 0.3
if len(sys.argv) >= 3:
# Data collection mode... | 35.595092 | 229 | 0.665805 |
from __future__ import division
from comms import *
import serial
import sys
import time
import pickle
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from scipy.integrate import odeint
PWM_DUTY_CYCLE = 0.3
if len(sys.argv) >= 3:
port = sys.argv[1]
... | true | true |
1c24c1745c670cd40db3e5595ad4c2a952ef7fad | 7,172 | py | Python | google/appengine/ext/mapreduce/api/map_job/map_job_control.py | vladushakov987/appengine_python3 | 0dd481c73e2537a50ee10f1b79cd65938087e555 | [
"Apache-2.0"
] | null | null | null | google/appengine/ext/mapreduce/api/map_job/map_job_control.py | vladushakov987/appengine_python3 | 0dd481c73e2537a50ee10f1b79cd65938087e555 | [
"Apache-2.0"
] | null | null | null | google/appengine/ext/mapreduce/api/map_job/map_job_control.py | vladushakov987/appengine_python3 | 0dd481c73e2537a50ee10f1b79cd65938087e555 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2007 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 o... | 28.460317 | 80 | 0.707892 |
from builtins import object
from google.appengine.api import taskqueue
from google.appengine.datastore import datastore_rpc
from google.appengine.ext import db
from google.appengine.ext.mapreduce import model
from google.appengine.ext.mapreduce import util
from google.appengine.ext.mapreduce.api.map_j... | true | true |
1c24c19a7b35d8e73b38af45df49cd8168f29cf3 | 10,911 | py | Python | viper/core/database.py | idiom/viper | d23823b4457c98eef67693445e879daf35232c82 | [
"BSD-3-Clause"
] | null | null | null | viper/core/database.py | idiom/viper | d23823b4457c98eef67693445e879daf35232c82 | [
"BSD-3-Clause"
] | null | null | null | viper/core/database.py | idiom/viper | d23823b4457c98eef67693445e879daf35232c82 | [
"BSD-3-Clause"
] | null | null | null | # This file is part of Viper - https://github.com/botherder/viper
# See the file 'LICENSE' for copying permission.
from datetime import datetime
from sqlalchemy import *
from sqlalchemy.pool import NullPool
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, backref, sessi... | 31.174286 | 118 | 0.539364 |
from datetime import datetime
from sqlalchemy import *
from sqlalchemy.pool import NullPool
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, backref, sessionmaker
from sqlalchemy.exc import SQLAlchemyError, IntegrityError
from viper.common.out import *
from viper.com... | true | true |
1c24c2a1e66fa1c49d87cc71cdde4f88c04d0c1c | 5,537 | py | Python | bayom_e/model_handling/model_inspection.py | dkauf42/bayota | 104ba91746231be10419390a9d7ed8f2593a21bc | [
"BSD-3-Clause"
] | 1 | 2021-07-23T18:09:55.000Z | 2021-07-23T18:09:55.000Z | bayom_e/model_handling/model_inspection.py | dkauf42/bayota | 104ba91746231be10419390a9d7ed8f2593a21bc | [
"BSD-3-Clause"
] | null | null | null | bayom_e/model_handling/model_inspection.py | dkauf42/bayota | 104ba91746231be10419390a9d7ed8f2593a21bc | [
"BSD-3-Clause"
] | null | null | null |
# Computation
import numpy as np
import pandas as pd
import pyomo.environ as pyo
# BAYOTA
from bayom_e.model_handling.utils import get_list_of_index_sets
from castjeeves.jeeves import Jeeves
jeeves = Jeeves()
def print_lens(model):
print(f"# of parcels: {len(model.PARCELS)}")
print(f"\t# of lrsegs: {len(mo... | 35.044304 | 100 | 0.638613 |
import numpy as np
import pandas as pd
import pyomo.environ as pyo
from bayom_e.model_handling.utils import get_list_of_index_sets
from castjeeves.jeeves import Jeeves
jeeves = Jeeves()
def print_lens(model):
print(f"# of parcels: {len(model.PARCELS)}")
print(f"\t# of lrsegs: {len(model.LRSEGS)}")
pr... | true | true |
1c24c3273c6e53a56d72eb0e3ce7df990156ab71 | 651 | py | Python | ota_xml_api/util/date.py | mihira/opentravel-xml-api | 24d1ea4d24cf2575de474becaa665f6fc0d1971d | [
"MIT"
] | 3 | 2016-01-14T01:12:06.000Z | 2021-04-16T04:00:47.000Z | ota_xml_api/util/date.py | mihira/opentravel-xml-api | 24d1ea4d24cf2575de474becaa665f6fc0d1971d | [
"MIT"
] | null | null | null | ota_xml_api/util/date.py | mihira/opentravel-xml-api | 24d1ea4d24cf2575de474becaa665f6fc0d1971d | [
"MIT"
] | 2 | 2017-09-04T13:02:09.000Z | 2018-06-09T11:10:03.000Z | #!/usr/bin/env python
"""
This module contains classes/functions related to date
"""
from datetime import date
class Period(object):
def __init__(self, days=1, start_gap=0):
today_ord = date.today().toordinal()
start_ord = today_ord + start_gap
end_ord = start_ord + days
self._sta... | 27.125 | 65 | 0.671275 |
from datetime import date
class Period(object):
def __init__(self, days=1, start_gap=0):
today_ord = date.today().toordinal()
start_ord = today_ord + start_gap
end_ord = start_ord + days
self._start = date.fromordinal(start_ord)
self._end = date.fromordinal(end_ord)
... | true | true |
1c24c33854f7e3026a3568678794ece64c6ffce0 | 1,243 | py | Python | parser/fase2/team07/Tytus_SQLPARSER_G8/Instrucciones/FunctionAgregate/Sum.py | Josue-Zea/tytus | f9e4be9a8c03eb698fade7a748972e4f52d46685 | [
"MIT"
] | 35 | 2020-12-07T03:11:43.000Z | 2021-04-15T17:38:16.000Z | parser/fase2/team07/Tytus_SQLPARSER_G8/Instrucciones/FunctionAgregate/Sum.py | Josue-Zea/tytus | f9e4be9a8c03eb698fade7a748972e4f52d46685 | [
"MIT"
] | 47 | 2020-12-09T01:29:09.000Z | 2021-01-13T05:37:50.000Z | parser/fase2/team07/Tytus_SQLPARSER_G8/Instrucciones/FunctionAgregate/Sum.py | Josue-Zea/tytus | f9e4be9a8c03eb698fade7a748972e4f52d46685 | [
"MIT"
] | 556 | 2020-12-07T03:13:31.000Z | 2021-06-17T17:41:10.000Z | from Instrucciones.TablaSimbolos.Instruccion import Instruccion
from Instrucciones.Excepcion import Excepcion
import numpy as np
class Sum(Instruccion):
def __init__(self, valor, tipo, strGram, linea, columna, strSent):
Instruccion.__init__(self,tipo,linea,columna, strGram, strSent)
self.valor = val... | 36.558824 | 117 | 0.609815 | from Instrucciones.TablaSimbolos.Instruccion import Instruccion
from Instrucciones.Excepcion import Excepcion
import numpy as np
class Sum(Instruccion):
def __init__(self, valor, tipo, strGram, linea, columna, strSent):
Instruccion.__init__(self,tipo,linea,columna, strGram, strSent)
self.valor = val... | true | true |
1c24c378b242f9fef1a26647a140b86022e6e564 | 10,306 | py | Python | tempest/tests/cmd/test_subunit_describe_calls.py | gamado/ds_tempest_rm_me_please | 3f5d149b3a32e713c60c59a054035ac2e5c73c28 | [
"Apache-2.0"
] | null | null | null | tempest/tests/cmd/test_subunit_describe_calls.py | gamado/ds_tempest_rm_me_please | 3f5d149b3a32e713c60c59a054035ac2e5c73c28 | [
"Apache-2.0"
] | null | null | null | tempest/tests/cmd/test_subunit_describe_calls.py | gamado/ds_tempest_rm_me_please | 3f5d149b3a32e713c60c59a054035ac2e5c73c28 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Rackspace
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 52.314721 | 78 | 0.496798 |
import os
import subprocess
import tempfile
from tempest.cmd import subunit_describe_calls
from tempest.tests import base
class TestSubunitDescribeCalls(base.TestCase):
def test_return_code(self):
subunit_file = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
... | true | true |
1c24c4f23bdef812b25c2967bb6e280d89e367b8 | 16,812 | py | Python | adafruit_portalbase/__init__.py | zsimpso/Adafruit_CircuitPython_PortalBase | 41ffc84b9753a9dbc6e15c7982ac1ebc3f2acf13 | [
"Unlicense",
"MIT-0",
"MIT"
] | null | null | null | adafruit_portalbase/__init__.py | zsimpso/Adafruit_CircuitPython_PortalBase | 41ffc84b9753a9dbc6e15c7982ac1ebc3f2acf13 | [
"Unlicense",
"MIT-0",
"MIT"
] | null | null | null | adafruit_portalbase/__init__.py | zsimpso/Adafruit_CircuitPython_PortalBase | 41ffc84b9753a9dbc6e15c7982ac1ebc3f2acf13 | [
"Unlicense",
"MIT-0",
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2020 Melissa LeBlanc-Williams for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_portalbase`
================================================================================
Base ... | 36.232759 | 100 | 0.594694 |
import gc
import time
import terminalio
from adafruit_bitmap_font import bitmap_font
from adafruit_display_text.bitmap_label import Label
from adafruit_display_text import wrap_text_to_lines
__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PortalBase.git"
class PortalBa... | true | true |
1c24c5364804b0e4664d3652b9907763cc4c1588 | 2,077 | py | Python | build/lib/fzutils/spider/auto.py | superonesfazai/fzutils | a8aafaacd94af0001af2ab139f0aa8cbcb8b5eda | [
"MIT"
] | 11 | 2018-08-04T08:14:27.000Z | 2021-09-03T09:00:33.000Z | build/lib/fzutils/spider/auto.py | superonesfazai/fzutils | a8aafaacd94af0001af2ab139f0aa8cbcb8b5eda | [
"MIT"
] | null | null | null | build/lib/fzutils/spider/auto.py | superonesfazai/fzutils | a8aafaacd94af0001af2ab139f0aa8cbcb8b5eda | [
"MIT"
] | 8 | 2018-08-04T08:16:17.000Z | 2019-05-05T09:17:35.000Z | # coding:utf-8
import codecs
from requests import get
# import sys
# from templates.config import config
# sys.path.append('..')
# from time_utils import get_shanghai_time
# from os.path import dirname
# from fzutils import spider
from ..time_utils import get_shanghai_time
from .templates.config import config
__all... | 26.974026 | 91 | 0.577756 |
import codecs
from requests import get
from ..time_utils import get_shanghai_time
from .templates.config import config
__all__ = [
'auto_generate_crawler_code',
]
def auto_generate_crawler_code():
def get_template_str():
... | true | true |
1c24c877cc54dd370628f44ff888ecd00cb5352b | 12,248 | py | Python | mvsnet/test.py | brandontan99/MVSNet | 18bfe23cfa54f8bfe1ac160aadef8a811b9dd94b | [
"MIT"
] | null | null | null | mvsnet/test.py | brandontan99/MVSNet | 18bfe23cfa54f8bfe1ac160aadef8a811b9dd94b | [
"MIT"
] | null | null | null | mvsnet/test.py | brandontan99/MVSNet | 18bfe23cfa54f8bfe1ac160aadef8a811b9dd94b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Copyright 2019, Yao Yao, HKUST.
Test script.
"""
from __future__ import print_function
import os
import time
import sys
import math
import argparse
import numpy as np
import cv2
import tensorflow as tf
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
sys.path.append("../")
fr... | 43.899642 | 106 | 0.590464 |
from __future__ import print_function
import os
import time
import sys
import math
import argparse
import numpy as np
import cv2
import tensorflow as tf
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
sys.path.append("../")
from tools.common import Notify
from preprocess import *
from model import *... | true | true |
1c24c879463dd18b6e49b714d12e085c00a89061 | 3,788 | py | Python | yatsm/masking.py | TedrosGitHub/TSA-yatsm | 8e328f366c8fd94d5cc57cd2cc42080c43d1f391 | [
"MIT"
] | 59 | 2015-02-03T19:56:17.000Z | 2022-03-17T13:45:23.000Z | yatsm/masking.py | TedrosGitHub/TSA-yatsm | 8e328f366c8fd94d5cc57cd2cc42080c43d1f391 | [
"MIT"
] | 97 | 2015-02-12T05:18:38.000Z | 2020-06-09T16:10:38.000Z | yatsm/masking.py | TedrosGitHub/TSA-yatsm | 8e328f366c8fd94d5cc57cd2cc42080c43d1f391 | [
"MIT"
] | 35 | 2015-02-27T19:43:23.000Z | 2021-06-21T02:29:14.000Z | from __future__ import division
import numpy as np
from .accel import try_jit
from .regression import robust_fit as rlm
ndays = 365.25
@try_jit() # np.array prevents nopython
def multitemp_mask(x, Y, n_year, crit=400,
green=1, swir1=4,
maxiter=10):
""" Multi-temporal mask... | 32.101695 | 78 | 0.586853 | from __future__ import division
import numpy as np
from .accel import try_jit
from .regression import robust_fit as rlm
ndays = 365.25
@try_jit()
def multitemp_mask(x, Y, n_year, crit=400,
green=1, swir1=4,
maxiter=10):
green = Y[green, :]
swir1 = Y[swir1, :]
n_... | true | true |
1c24c9e1f0f24a2f0c0a8269be703e722d10401a | 4,114 | py | Python | django_summernote/views.py | andreykko/django-summernote | 7910d01f58f4c319ec96289fab4674d50e795066 | [
"MIT"
] | 1 | 2018-08-31T17:40:04.000Z | 2018-08-31T17:40:04.000Z | django_summernote/views.py | andreykko/django-summernote | 7910d01f58f4c319ec96289fab4674d50e795066 | [
"MIT"
] | null | null | null | django_summernote/views.py | andreykko/django-summernote | 7910d01f58f4c319ec96289fab4674d50e795066 | [
"MIT"
] | null | null | null | from django import VERSION as django_version
from django.templatetags.static import static
from django.http import HttpResponse, JsonResponse
from django.template.loader import render_to_string
from django.utils.translation import ugettext as _
from django.views.generic import TemplateView
from django_summernote.utils ... | 34.571429 | 96 | 0.590423 | from django import VERSION as django_version
from django.templatetags.static import static
from django.http import HttpResponse, JsonResponse
from django.template.loader import render_to_string
from django.utils.translation import ugettext as _
from django.views.generic import TemplateView
from django_summernote.utils ... | true | true |
1c24ca3fc9bb5ef0ed2ac9d6f30d47ab1d91113e | 6,037 | py | Python | python/GafferUITest/PlugValueWidgetTest.py | ACFX/gaffer | 4519dbfa2beb09d724eeb0b6d3d76dc4c1326cca | [
"BSD-3-Clause"
] | 31 | 2017-07-10T10:02:07.000Z | 2022-02-08T13:54:14.000Z | python/GafferUITest/PlugValueWidgetTest.py | ACFX/gaffer | 4519dbfa2beb09d724eeb0b6d3d76dc4c1326cca | [
"BSD-3-Clause"
] | null | null | null | python/GafferUITest/PlugValueWidgetTest.py | ACFX/gaffer | 4519dbfa2beb09d724eeb0b6d3d76dc4c1326cca | [
"BSD-3-Clause"
] | 3 | 2017-11-04T15:30:11.000Z | 2018-09-25T18:36:11.000Z | ##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... | 37.968553 | 112 | 0.69455 | true | true | |
1c24ca8a87abc0a4d9c5702e430ec96c58ff8bb0 | 433,613 | py | Python | tests/test_other.py | aduh95/emscripten | 68f3899f2e3570ca8e7866853ddc90f175406349 | [
"MIT"
] | null | null | null | tests/test_other.py | aduh95/emscripten | 68f3899f2e3570ca8e7866853ddc90f175406349 | [
"MIT"
] | null | null | null | tests/test_other.py | aduh95/emscripten | 68f3899f2e3570ca8e7866853ddc90f175406349 | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
# noqa: E241
from __future__ import print_function
fr... | 41.190558 | 382 | 0.623344 |
from __future__ import print_function
from functools import wraps
import glob
import gzip
import itertools
import json
import os
import pipes
import re
import select
import shlex
import shutil
import struct
import subprocess
import sys
import time
import tempfile
import unittest
import uuid
from subprocess impo... | true | true |
1c24cbb151e8c0c40c062ad7d1238177434a9c63 | 3,336 | py | Python | plugins/PY/pinpointPy/libs/urllib/UrlOpenPlugin.py | naver/pinpoint-c-agent | 5c4f03a242d0ef219d9ca35c2c3241e9396dcb1b | [
"Apache-2.0"
] | 178 | 2018-08-30T06:54:35.000Z | 2020-10-08T13:45:21.000Z | plugins/PY/pinpointPy/libs/urllib/UrlOpenPlugin.py | naver/pinpoint-c-agent | 5c4f03a242d0ef219d9ca35c2c3241e9396dcb1b | [
"Apache-2.0"
] | 122 | 2018-08-30T11:57:20.000Z | 2020-10-13T21:38:22.000Z | plugins/PY/pinpointPy/libs/urllib/UrlOpenPlugin.py | naver/pinpoint-c-agent | 5c4f03a242d0ef219d9ca35c2c3241e9396dcb1b | [
"Apache-2.0"
] | 60 | 2018-08-30T07:16:56.000Z | 2020-09-30T13:49:36.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# ------------------------------------------------------------------------------
# Copyright 2020. NAVER Corp. -
# -
# Licensed under the Apache L... | 43.894737 | 105 | 0.494604 |
from urllib.parse import urlparse
from ... import Common
from ... import Defines
from ... import pinpoint
from ... import Helper
class UrlOpenPlugin(Common.PinTrace):
def __init__(self, name):
super().__init__(name)
def isSample(self,args):
url = args[0][0]
target... | true | true |
1c24cc095a51123cc96d454b28ef5fc24deffe97 | 175,038 | py | Python | test/sql/test_metadata.py | SamuelMarks/sqlalchemy | 1d2b49bc991ca866fd71da3ccfbcde5093482512 | [
"MIT"
] | 2 | 2018-09-24T09:51:03.000Z | 2019-02-25T23:47:58.000Z | test/sql/test_metadata.py | SamuelMarks/sqlalchemy | 1d2b49bc991ca866fd71da3ccfbcde5093482512 | [
"MIT"
] | null | null | null | test/sql/test_metadata.py | SamuelMarks/sqlalchemy | 1d2b49bc991ca866fd71da3ccfbcde5093482512 | [
"MIT"
] | null | null | null | from contextlib import contextmanager
import pickle
import sqlalchemy as tsa
from sqlalchemy import ARRAY
from sqlalchemy import bindparam
from sqlalchemy import BLANK_SCHEMA
from sqlalchemy import Boolean
from sqlalchemy import CheckConstraint
from sqlalchemy import Column
from sqlalchemy import column
from sqlalchem... | 31.755806 | 79 | 0.541237 | from contextlib import contextmanager
import pickle
import sqlalchemy as tsa
from sqlalchemy import ARRAY
from sqlalchemy import bindparam
from sqlalchemy import BLANK_SCHEMA
from sqlalchemy import Boolean
from sqlalchemy import CheckConstraint
from sqlalchemy import Column
from sqlalchemy import column
from sqlalchem... | true | true |
1c24cc48b4ea126b08db4b6a7b1cdb2643b63563 | 398 | py | Python | reddit_backend/reddit-backend/wsgi.py | cursedclock/reddit-backend | fb5989c758f5459e510f6599c9b9798424c17ba9 | [
"MIT"
] | 1 | 2022-01-30T17:27:44.000Z | 2022-01-30T17:27:44.000Z | reddit_backend/reddit-backend/wsgi.py | cursedclock/reddit-backend | fb5989c758f5459e510f6599c9b9798424c17ba9 | [
"MIT"
] | null | null | null | reddit_backend/reddit-backend/wsgi.py | cursedclock/reddit-backend | fb5989c758f5459e510f6599c9b9798424c17ba9 | [
"MIT"
] | null | null | null | """
WSGI config for backend 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/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... | 23.411765 | 78 | 0.786432 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "reddit-backend.settings")
application = get_wsgi_application()
| true | true |
1c24ced8be51d5794bcbfa009fa254e03548f180 | 1,122 | py | Python | clusterizer/randomize.py | zeionara/clusterizer | 4a240051a2da0094943dce1cbe487f5b3113615b | [
"BSD-3-Clause"
] | null | null | null | clusterizer/randomize.py | zeionara/clusterizer | 4a240051a2da0094943dce1cbe487f5b3113615b | [
"BSD-3-Clause"
] | null | null | null | clusterizer/randomize.py | zeionara/clusterizer | 4a240051a2da0094943dce1cbe487f5b3113615b | [
"BSD-3-Clause"
] | null | null | null | import argparse
from clusterizer.filesystem import get_random_lines, write_file
from clusterizer.loggers import log
def parse_args():
parser = argparse.ArgumentParser(description = "Generate file containing random subset of lines from a larger file")
parser.add_argument('-in', '--input', help = 'input file f... | 51 | 155 | 0.72549 | import argparse
from clusterizer.filesystem import get_random_lines, write_file
from clusterizer.loggers import log
def parse_args():
parser = argparse.ArgumentParser(description = "Generate file containing random subset of lines from a larger file")
parser.add_argument('-in', '--input', help = 'input file f... | true | true |
1c24cedcb3bd852e3971e8c8795c43c4f39a5b8d | 927 | py | Python | bookworm/signals.py | mush42/bookworm | a4bdd89363137a89a1bed1e9e072de4fb55576fd | [
"MIT"
] | 18 | 2019-07-19T22:12:15.000Z | 2020-08-26T17:45:19.000Z | bookworm/signals.py | mush42/bookworm | a4bdd89363137a89a1bed1e9e072de4fb55576fd | [
"MIT"
] | 44 | 2019-07-15T10:17:00.000Z | 2020-07-26T11:22:53.000Z | bookworm/signals.py | mush42/bookworm | a4bdd89363137a89a1bed1e9e072de4fb55576fd | [
"MIT"
] | 9 | 2019-09-03T13:13:31.000Z | 2020-08-25T13:55:27.000Z | # coding: utf-8
"""
Implements the core signals of bookworm.
"""
from blinker import Namespace
# The namespace of bookworm signals
_signals = Namespace()
# Core app signals
app_booting = _signals.signal("app/booting")
app_starting = _signals.signal("app/starting")
app_started = _signals.signal("app/started")
app_w... | 26.485714 | 66 | 0.795038 |
from blinker import Namespace
_signals = Namespace()
app_booting = _signals.signal("app/booting")
app_starting = _signals.signal("app/starting")
app_started = _signals.signal("app/started")
app_window_shown = _signals.signal("app/window_shown")
app_shuttingdown = _signals.signal("app/shuttingdown")
reader_boo... | true | true |
1c24d02a593a195114052955638c78d1202924ad | 4,935 | py | Python | 2_tensor_networks/a_mps.py | harrow/computational_QM | d8a2060bee6a55c4b8bf937ad96feed10227373b | [
"MIT"
] | 25 | 2019-03-07T08:41:24.000Z | 2022-02-19T21:31:11.000Z | 2_tensor_networks/a_mps.py | harrow/computational_QM | d8a2060bee6a55c4b8bf937ad96feed10227373b | [
"MIT"
] | 2 | 2019-05-15T12:30:41.000Z | 2019-07-03T18:08:12.000Z | 2_tensor_networks/a_mps.py | harrow/computational_QM | d8a2060bee6a55c4b8bf937ad96feed10227373b | [
"MIT"
] | 9 | 2018-12-04T21:01:33.000Z | 2021-04-27T15:35:31.000Z | """Toy code implementing a matrix product state."""
import numpy as np
from scipy.linalg import svd
class MPS:
"""Class for a matrix product state.
We index sites with `i` from 0 to L-1; bond `i` is left of site `i`.
We *assume* that the state is in right-canonical form.
Parameters
----------
... | 35.503597 | 98 | 0.54387 |
import numpy as np
from scipy.linalg import svd
class MPS:
def __init__(self, Bs, Ss):
self.Bs = Bs
self.Ss = Ss
self.L = len(Bs)
def copy(self):
return MPS([B.copy() for B in self.Bs], [S.copy() for S in self.Ss])
def get_theta1(self, i):
return np.tensordot(np... | true | true |
1c24d0e2b399ba4b778f7ee72b29dc4e7099ab69 | 2,303 | py | Python | keystone/policy/controllers.py | andy-ning/stx-keystone | d25ef53d1a152025b78dbf7780b93fe356323836 | [
"Apache-2.0"
] | 1 | 2019-05-08T06:09:35.000Z | 2019-05-08T06:09:35.000Z | keystone/policy/controllers.py | andy-ning/stx-keystone | d25ef53d1a152025b78dbf7780b93fe356323836 | [
"Apache-2.0"
] | 4 | 2018-08-22T14:51:02.000Z | 2018-10-17T14:04:26.000Z | keystone/policy/controllers.py | andy-ning/stx-keystone | d25ef53d1a152025b78dbf7780b93fe356323836 | [
"Apache-2.0"
] | 5 | 2018-08-03T17:19:34.000Z | 2019-01-11T15:54:42.000Z | # Copyright 2012 OpenStack Foundation
#
# 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... | 38.383333 | 75 | 0.718194 |
from keystone.common import controller
from keystone.common import dependency
from keystone.common import validation
from keystone.policy import schema
@dependency.requires('policy_api')
class PolicyV3(controller.V3Controller):
collection_name = 'policies'
member_name = 'policy'
@controller... | true | true |
1c24d1e6cac44db212b59ead76423dcf941feb51 | 661 | py | Python | day-4-python-division.py | roshansinghbisht/hello-python | 595418a47e66217ed8759c91cdb535e8fa88412b | [
"MIT"
] | null | null | null | day-4-python-division.py | roshansinghbisht/hello-python | 595418a47e66217ed8759c91cdb535e8fa88412b | [
"MIT"
] | null | null | null | day-4-python-division.py | roshansinghbisht/hello-python | 595418a47e66217ed8759c91cdb535e8fa88412b | [
"MIT"
] | null | null | null | # TASK:
# The provided code stub reads two integers, a and b, from STDIN.
# Add logic to print two lines. The first line should contain the
# result of integer division, a//b . The second line should
# contain the result of float division, a/b .
a = int(input())
b = int(input())
print("Integer division =", a//b)
pri... | 36.722222 | 72 | 0.727685 |
a = int(input())
b = int(input())
print("Integer division =", a//b)
print("Float division =", a/b)
| true | true |
1c24d3f5cb372ec28405771e1c18ff8a7efbcfb8 | 8,065 | py | Python | openstack/tests/functional/baremetal/test_baremetal_node.py | afontscd/openstacksdk | cb66a98f286dddabd1f593b45049c73192227186 | [
"Apache-2.0"
] | null | null | null | openstack/tests/functional/baremetal/test_baremetal_node.py | afontscd/openstacksdk | cb66a98f286dddabd1f593b45049c73192227186 | [
"Apache-2.0"
] | null | null | null | openstack/tests/functional/baremetal/test_baremetal_node.py | afontscd/openstacksdk | cb66a98f286dddabd1f593b45049c73192227186 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 43.360215 | 79 | 0.614259 |
import uuid
from openstack import exceptions
from openstack.tests.functional.baremetal import base
class TestBareMetalNode(base.BaseBaremetalTest):
def test_node_create_get_delete(self):
node = self.create_node(name='node-name')
self.assertEqual(node.name, 'node-name')
self.as... | true | true |
1c24d564254333f57ae593e9b4f482083e762577 | 2,520 | py | Python | dist/weewx-4.6.2/examples/colorize/colorize_2.py | Zilched/docker-weewx | 406b32c3b40563a99a09a76b9b091700c7e46910 | [
"Apache-2.0"
] | 1 | 2016-03-17T11:39:45.000Z | 2016-03-17T11:39:45.000Z | dist/weewx-4.6.2/examples/colorize/colorize_2.py | mitct02/docker-weewx | 76f4e3dd9af88ba521f431b07a3762ecb2820464 | [
"Apache-2.0"
] | null | null | null | dist/weewx-4.6.2/examples/colorize/colorize_2.py | mitct02/docker-weewx | 76f4e3dd9af88ba521f431b07a3762ecb2820464 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2022 Tom Keffer <tkeffer@gmail.com>
# See the file LICENSE.txt for your rights.
"""Pick a color on the basis of a temperature. This version works for any unit system.
*******************************************************************************
This search list extension offers an extra tag:
... | 31.898734 | 87 | 0.524206 |
import weewx.units
from weewx.cheetahgenerator import SearchList
class Colorize(SearchList):
def colorize(self, value_vh):
value_vt = value_vh.value_t
t_celsius =... | true | true |
1c24d61c3b5fdad652a6af92a6f3c48ca9b2adad | 1,039 | py | Python | Modulos_y_Paquetes.py | w2k31984/Selenium_WebDriver_Python | 73e509813c6a5e508677920fa76c8cc56371134b | [
"MIT",
"MIT-0"
] | null | null | null | Modulos_y_Paquetes.py | w2k31984/Selenium_WebDriver_Python | 73e509813c6a5e508677920fa76c8cc56371134b | [
"MIT",
"MIT-0"
] | null | null | null | Modulos_y_Paquetes.py | w2k31984/Selenium_WebDriver_Python | 73e509813c6a5e508677920fa76c8cc56371134b | [
"MIT",
"MIT-0"
] | null | null | null | #Importando un archivo teniendo acceso a sus funciones.
#Un modulo es aquel capaz de reutilizar funciones.
#import Funciones_Modulos
#Es buena practica en los paquetes dentro de la carpeta crear un archivo __init__.py pues indica a python que es un paquete.
#from Matematicas import Funciones_Matematica
#Otra forma de l... | 41.56 | 124 | 0.799808 |
from Matematicas.Funciones_Matematica import suma,resta,multiplicacion,division
suma(num1= 7, num2=20)
resta(num1= 27, num2=20)
multiplicacion(num1= 9, num2=3)
division(num1= 9, num2=3) | true | true |
1c24d7d75a65ffcbf8e0f69661b386d2f710a0e0 | 2,307 | py | Python | hub_module/tests/unittests/test_mobilenet_v1.py | 18621579069/PaddleHub-yu | 15e8bcef2addf239081e235bdcfd039de12330e0 | [
"Apache-2.0"
] | 4 | 2021-02-25T03:27:38.000Z | 2021-05-15T03:20:23.000Z | hub_module/tests/unittests/test_mobilenet_v1.py | 18621579069/PaddleHub-yu | 15e8bcef2addf239081e235bdcfd039de12330e0 | [
"Apache-2.0"
] | null | null | null | hub_module/tests/unittests/test_mobilenet_v1.py | 18621579069/PaddleHub-yu | 15e8bcef2addf239081e235bdcfd039de12330e0 | [
"Apache-2.0"
] | 2 | 2021-03-01T07:04:01.000Z | 2021-05-14T05:54:18.000Z | # coding=utf-8
import os
import unittest
import cv2
import numpy as np
import paddle.fluid as fluid
import paddlehub as hub
class TestMobileNetV1(unittest.TestCase):
@classmethod
def setUpClass(self):
"""Prepare the environment once before execution of all tests."""
# self.mobilenet_v1 = hub.... | 33.926471 | 73 | 0.601214 |
import os
import unittest
import cv2
import numpy as np
import paddle.fluid as fluid
import paddlehub as hub
class TestMobileNetV1(unittest.TestCase):
@classmethod
def setUpClass(self):
self.mobilenet_v1 = hub.Module(name='mobilenet_v1_imagenet')
@classmethod
def tearDownClass(self... | true | true |
1c24d8b487e547fe9509f6d8599ce346c100faa6 | 6,960 | py | Python | pySUTtoIO/transformation_model_b.py | CMLPlatform/pysuttoio | 4d0c2de6c7d6d90e9caf4b5b361e5046828bf113 | [
"MIT"
] | null | null | null | pySUTtoIO/transformation_model_b.py | CMLPlatform/pysuttoio | 4d0c2de6c7d6d90e9caf4b5b361e5046828bf113 | [
"MIT"
] | null | null | null | pySUTtoIO/transformation_model_b.py | CMLPlatform/pysuttoio | 4d0c2de6c7d6d90e9caf4b5b361e5046828bf113 | [
"MIT"
] | null | null | null | import math
import numpy as np
import os.path
import pySUTtoIO.tools as tl
import pySUTtoIO.sut as st
from pySUTtoIO.secondary_flows import make_secondary as ms
class TransformationModelB:
"""A supply-use table to input-output table transformation object.
From the supply-use table a product-by-product input-o... | 43.229814 | 118 | 0.642385 | import math
import numpy as np
import os.path
import pySUTtoIO.tools as tl
import pySUTtoIO.sut as st
from pySUTtoIO.secondary_flows import make_secondary as ms
class TransformationModelB:
default_rel_tol = 1E-3
debug = False
debug_data_dir = os.path.join('data', 'transformed', '2010', 'sut')
def __... | true | true |
1c24d98b1982dddd25161c9c361df16236f3327d | 2,038 | py | Python | sdk/compute/azure-mgmt-imagebuilder/azure/mgmt/imagebuilder/models/api_error_py3.py | kushan2018/azure-sdk-for-python | 08a9296207281f4e90e23cf7a30173863accc867 | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/compute/azure-mgmt-imagebuilder/azure/mgmt/imagebuilder/models/api_error_py3.py | kushan2018/azure-sdk-for-python | 08a9296207281f4e90e23cf7a30173863accc867 | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-imagebuilder/azure/mgmt/imagebuilder/models/api_error_py3.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 35.137931 | 129 | 0.618253 |
from msrest.serialization import Model
from msrest.exceptions import HttpOperationError
class ApiError(Model):
_attribute_map = {
'details': {'key': 'details', 'type': '[ApiErrorBase]'},
'inner_error': {'key': 'innerError', 'type': 'InnerError'},
'code': {'key': 'code', 'type':... | true | true |
1c24da9acb3e8a5f4520a39ae7bdfa5503bb1b6b | 14,874 | py | Python | car_detection.py | Sawera557/PhotoChamp-Image-Forensic-Tool | e7550a97d33cdf58a66ea0efcc451178bfd88a8d | [
"MIT"
] | null | null | null | car_detection.py | Sawera557/PhotoChamp-Image-Forensic-Tool | e7550a97d33cdf58a66ea0efcc451178bfd88a8d | [
"MIT"
] | null | null | null | car_detection.py | Sawera557/PhotoChamp-Image-Forensic-Tool | e7550a97d33cdf58a66ea0efcc451178bfd88a8d | [
"MIT"
] | null | null | null | # from car_result import ui_MainWindow
from optparse import OptionParser
from PIL import Image
from PyQt5 import QtCore
from PyQt5 import QtGui, QtWidgets
from PyQt5.QtCore import *
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QApplication, QFileDialog, QFrame, QComboBox, QLineEdit, QLabel, QMes... | 39.558511 | 219 | 0.585048 |
from optparse import OptionParser
from PIL import Image
from PyQt5 import QtCore
from PyQt5 import QtGui, QtWidgets
from PyQt5.QtCore import *
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QApplication, QFileDialog, QFrame, QComboBox, QLineEdit, QLabel, QMessageBox, QWidget, \
QPushButton
f... | true | true |
1c24dbea88df0ba695fd27d5c7fbe59f725ebd02 | 5,481 | py | Python | odoo-13.0/addons/stock_dropshipping/tests/test_dropship.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | odoo-13.0/addons/stock_dropshipping/tests/test_dropship.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | odoo-13.0/addons/stock_dropshipping/tests/test_dropship.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import common, Form
from odoo.tools import mute_logger
class TestDropship(common.TransactionCase):
def test_change_qty(self):
# enable the dropship and MTO route on the product
prod ... | 44.201613 | 112 | 0.612297 |
from odoo.tests import common, Form
from odoo.tools import mute_logger
class TestDropship(common.TransactionCase):
def test_change_qty(self):
prod = self.env.ref('product.product_product_8')
dropshipping_route = self.env.ref('stock_dropshipping.route_drop_shipping')
mto_route =... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.