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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f75004bd87cc2f7502a0eae77c8b7c5a7709a941 | 259 | py | Python | polog/handlers/file/rotation/rules/rules/date_time_rule.py | pomponchik/polog | 104c5068a65b0eaeab59327aac1a583e2606e77e | [
"MIT"
] | 30 | 2020-07-16T16:52:46.000Z | 2022-03-24T16:56:29.000Z | polog/handlers/file/rotation/rules/rules/date_time_rule.py | pomponchik/polog | 104c5068a65b0eaeab59327aac1a583e2606e77e | [
"MIT"
] | 6 | 2021-02-07T22:08:01.000Z | 2021-12-07T21:56:46.000Z | polog/handlers/file/rotation/rules/rules/date_time_rule.py | pomponchik/polog | 104c5068a65b0eaeab59327aac1a583e2606e77e | [
"MIT"
] | 4 | 2020-12-22T07:05:34.000Z | 2022-03-24T16:56:50.000Z | from polog.handlers.file.rotation.rules.rules.file_size_rule import AbstractRule
class DateTimeRule(AbstractRule):
@classmethod
def prove_source(cls, source):
raise NotImplementedError
def check(self):
raise NotImplementedError
| 23.545455 | 80 | 0.752896 | from polog.handlers.file.rotation.rules.rules.file_size_rule import AbstractRule
class DateTimeRule(AbstractRule):
@classmethod
def prove_source(cls, source):
raise NotImplementedError
def check(self):
raise NotImplementedError
| true | true |
f750060a02622c8ae794e0b3554bb134fbe0fb67 | 1,144 | py | Python | Artificial Intelligence/dfs.py | Candida18/AI_CSS_MC | 72afc0e26f242ebf53a46e25534731bb9e6275f8 | [
"MIT"
] | null | null | null | Artificial Intelligence/dfs.py | Candida18/AI_CSS_MC | 72afc0e26f242ebf53a46e25534731bb9e6275f8 | [
"MIT"
] | null | null | null | Artificial Intelligence/dfs.py | Candida18/AI_CSS_MC | 72afc0e26f242ebf53a46e25534731bb9e6275f8 | [
"MIT"
] | null | null | null | '''graph1 = {
'A' : ['B','S'],
'B' : ['A'],
'C' : ['D','E','F','S'],
'D' : ['C'],
'E' : ['C','H'],
'F' : ['C','G'],
'G' : ['F','S'],
'H' : ['E','G'],
'S' : ['A','C','G']
}'''
def create_graph():
graph1={}
no_of_nodes = int(input("Enter the no. of nodes in the graph : "))
for i in range(0,no_of_nodes):
pr... | 23.346939 | 70 | 0.559441 |
def create_graph():
graph1={}
no_of_nodes = int(input("Enter the no. of nodes in the graph : "))
for i in range(0,no_of_nodes):
print("----"*16)
key = input("Enter the node : ")
print("For nodes adjacent to {}".format(key))
n = int(input("Enter number of adjacent nodes : "))
value = []
print("Ente... | true | true |
f75006cc5820695a7bd3c072790dc11e9480cfef | 1,502 | py | Python | models/hotel.py | marceloprni/FLASK_REST_API | 406f13fbe5d417bd1603b9730194e035b298b18b | [
"MIT"
] | null | null | null | models/hotel.py | marceloprni/FLASK_REST_API | 406f13fbe5d417bd1603b9730194e035b298b18b | [
"MIT"
] | null | null | null | models/hotel.py | marceloprni/FLASK_REST_API | 406f13fbe5d417bd1603b9730194e035b298b18b | [
"MIT"
] | null | null | null | from sql_alchemy import banco
class HotelModel(banco.Model):
__tablename__ = 'hoteis'
hotel_id = banco.Column(banco.String, primary_key=True)
nome = banco.Column(banco.String(80))
estrelas = banco.Column(banco.Float(precision=1))
diaria = banco.Column(banco.Float(precision=2))
cidade = banco.C... | 28.884615 | 76 | 0.601198 | from sql_alchemy import banco
class HotelModel(banco.Model):
__tablename__ = 'hoteis'
hotel_id = banco.Column(banco.String, primary_key=True)
nome = banco.Column(banco.String(80))
estrelas = banco.Column(banco.Float(precision=1))
diaria = banco.Column(banco.Float(precision=2))
cidade = banco.C... | true | true |
f7500827f492617af884d28c707a6bcbfd77e954 | 267 | py | Python | BOJ/greedy_implementation_boj/find_password.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | BOJ/greedy_implementation_boj/find_password.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | BOJ/greedy_implementation_boj/find_password.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | # BOJ 17219
import sys
si = sys.stdin.readline
n, m = map(int, si().split())
passwords = {}
for _ in range(n):
url, password = si().split()
passwords[url] = password
for _ in range(m):
url = si().strip()
sys.stdout.write(passwords[url])
print()
| 17.8 | 36 | 0.606742 |
import sys
si = sys.stdin.readline
n, m = map(int, si().split())
passwords = {}
for _ in range(n):
url, password = si().split()
passwords[url] = password
for _ in range(m):
url = si().strip()
sys.stdout.write(passwords[url])
print()
| true | true |
f7500a57cccb47fa0ed0d657396853a3498428fe | 1,110 | py | Python | f1_blog/urls.py | sakdag/f1-blog | b59cd85aeca388566a9932bc5c1bc681aac1645a | [
"MIT"
] | null | null | null | f1_blog/urls.py | sakdag/f1-blog | b59cd85aeca388566a9932bc5c1bc681aac1645a | [
"MIT"
] | null | null | null | f1_blog/urls.py | sakdag/f1-blog | b59cd85aeca388566a9932bc5c1bc681aac1645a | [
"MIT"
] | null | null | null | """f1_blog URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... | 39.642857 | 84 | 0.704505 | from django.contrib import admin
from django.urls import path, include
from django.views.generic import TemplateView
urlpatterns = [
path('admin/', admin.site.urls),
path('', TemplateView.as_view(template_name='f1_blog/index.html'), name='home'),
path('acounts/', include('apps.accounts.urls')),
path('a... | true | true |
f7500a68abbac5116aa122c805fe782674954349 | 7,158 | py | Python | dash/dcc/Slider.py | XYZ2333333/dash | 19048d82e5fb3a142b24d4f167a0098f0e9f4d1e | [
"MIT"
] | 1 | 2018-01-21T15:49:49.000Z | 2018-01-21T15:49:49.000Z | dash/dcc/Slider.py | XYZ2333333/dash | 19048d82e5fb3a142b24d4f167a0098f0e9f4d1e | [
"MIT"
] | null | null | null | dash/dcc/Slider.py | XYZ2333333/dash | 19048d82e5fb3a142b24d4f167a0098f0e9f4d1e | [
"MIT"
] | 1 | 2017-08-18T05:01:03.000Z | 2017-08-18T05:01:03.000Z | # AUTO GENERATED FILE - DO NOT EDIT
from dash.development.base_component import Component, _explicitize_args
class Slider(Component):
"""A Slider component.
A slider component with a single handle.
Keyword arguments:
- min (number; optional):
Minimum allowed value of the slider.
- max ... | 35.61194 | 135 | 0.612182 |
from dash.development.base_component import Component, _explicitize_args
class Slider(Component):
@_explicitize_args
def __init__(
self,
min=Component.UNDEFINED,
max=Component.UNDEFINED,
step=Component.UNDEFINED,
marks=Component.UNDEFINED,
value=Component.UND... | true | true |
f7500bf115ea21a8387437b522d75503962a6a65 | 1,190 | py | Python | Examples/In progress/CEE213 CP4.py | Komutsou/StructPy | 6b25b369ff14b31dbff4eb2cb4d6c43963ec7b3b | [
"MIT"
] | 46 | 2018-04-29T23:56:22.000Z | 2022-03-30T02:35:42.000Z | Examples/In progress/CEE213 CP4.py | Komutsou/StructPy | 6b25b369ff14b31dbff4eb2cb4d6c43963ec7b3b | [
"MIT"
] | 2 | 2018-11-06T03:11:34.000Z | 2020-12-11T07:11:13.000Z | Examples/In progress/CEE213 CP4.py | Komutsou/StructPy | 6b25b369ff14b31dbff4eb2cb4d6c43963ec7b3b | [
"MIT"
] | 25 | 2018-04-29T23:57:00.000Z | 2022-03-27T13:59:31.000Z | import numpy as np
import cross_sections as xs
xs1 = xs.IBeam(1, 1, 0.1, 0.1)
L = 10
p = 1
E = 29000
def constant(x, **kwargs):
return 1
def linearup(s, **kwargs):
return x
load = constant
def simpsons(f, a, b, n): #function, start, stop, intervals
if n % 2 == 0:
h = (b-a)/n
k = 0.0
x = a + h
for i ... | 18.030303 | 59 | 0.478992 | import numpy as np
import cross_sections as xs
xs1 = xs.IBeam(1, 1, 0.1, 0.1)
L = 10
p = 1
E = 29000
def constant(x, **kwargs):
return 1
def linearup(s, **kwargs):
return x
load = constant
def simpsons(f, a, b, n):
if n % 2 == 0:
h = (b-a)/n
k = 0.0
x = a + h
for i in range(1, int(n/2) + 1):
k +... | true | true |
f7500d09b88d000aeda85aa81f1f7c203ffcb90d | 1,853 | py | Python | janggoCompany/mainsite/views.py | jangheeseung/janggo_system | d251ad88483aa4a4ca43183cdb5d72ff98213540 | [
"MIT"
] | null | null | null | janggoCompany/mainsite/views.py | jangheeseung/janggo_system | d251ad88483aa4a4ca43183cdb5d72ff98213540 | [
"MIT"
] | null | null | null | janggoCompany/mainsite/views.py | jangheeseung/janggo_system | d251ad88483aa4a4ca43183cdb5d72ff98213540 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.utils import translation, timezone
from django.http import HttpResponseRedirect
from django.urls import reverse
from product.models import Product, Product_type
from .forms import ProductForm
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteg... | 32.508772 | 82 | 0.721533 | from django.shortcuts import render, redirect
from django.utils import translation, timezone
from django.http import HttpResponseRedirect
from django.urls import reverse
from product.models import Product, Product_type
from .forms import ProductForm
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteg... | true | true |
f7500e80768f8c0750263afa5156f9e8cf6f48ec | 22,399 | py | Python | Source/ThirdParty/libwebrtc/Source/PRESUBMIT.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 6 | 2021-07-05T16:09:39.000Z | 2022-03-06T22:44:42.000Z | Source/ThirdParty/libwebrtc/Source/PRESUBMIT.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 7 | 2022-03-15T13:25:39.000Z | 2022-03-15T13:25:44.000Z | Source/ThirdParty/libwebrtc/Source/PRESUBMIT.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... | 39.296491 | 80 | 0.700344 |
import json
import os
import re
import subprocess
import sys
CPPLINT_DIRS = [
'webrtc/api',
'webrtc/audio',
'webrtc/call',
'webrtc/common_video',
'webrtc/examples',
'webrtc/modules/audio_mixer',
'webrtc/modules/bitrate_controller',
'webrtc/modules/congestion_controller',
'webrtc/modules/pac... | true | true |
f7500ed1b35b04a4f65675ac2b039a3c53a5adcb | 16,040 | py | Python | racks/mainapp/services.py | 5lunk/racks | 32d46c7e9b46ad0fd65e72e9d597466fa88ec1fe | [
"CC0-1.0"
] | null | null | null | racks/mainapp/services.py | 5lunk/racks | 32d46c7e9b46ad0fd65e72e9d597466fa88ec1fe | [
"CC0-1.0"
] | 4 | 2022-02-14T13:13:29.000Z | 2022-03-10T05:31:06.000Z | racks/mainapp/services.py | 5lunk/Racks | 32d46c7e9b46ad0fd65e72e9d597466fa88ec1fe | [
"CC0-1.0"
] | null | null | null | import datetime
from django.db import models
from .models import (
Region,
Department,
Site,
Building,
Room,
Rack,
Device,
)
def _regions():
"""
All regions
"""
return Region.objects.all()
def _departments():
"""
All departments
"""
return Department... | 31.51277 | 91 | 0.426309 | import datetime
from django.db import models
from .models import (
Region,
Department,
Site,
Building,
Room,
Rack,
Device,
)
def _regions():
return Region.objects.all()
def _departments():
return Department.objects.all()
def _sites():
return Site.objects.all()
def _... | true | true |
f7500ee0c7b13740518ec3875a36db9e57111177 | 6,525 | py | Python | src/webui/_project.py | HildeTeamTNT/pyarmor | a699f43baa766d8826f801021f1f483d19fdcb87 | [
"OLDAP-2.5",
"Python-2.0"
] | 3 | 2020-05-11T12:01:48.000Z | 2021-04-23T16:33:54.000Z | src/webui/_project.py | HildeTeamTNT/pyarmor | a699f43baa766d8826f801021f1f483d19fdcb87 | [
"OLDAP-2.5",
"Python-2.0"
] | null | null | null | src/webui/_project.py | HildeTeamTNT/pyarmor | a699f43baa766d8826f801021f1f483d19fdcb87 | [
"OLDAP-2.5",
"Python-2.0"
] | null | null | null | import logging
import json
import os
import shutil
import subprocess
import sys
# PyArmor in the parent path
PYARMOR_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
os.environ['PYARMOR_PATH'] = PYARMOR_PATH
sys.path.insert(0, PYARMOR_PATH)
from config import version, config_filename, capsule_fil... | 25.790514 | 84 | 0.60751 | import logging
import json
import os
import shutil
import subprocess
import sys
PYARMOR_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
os.environ['PYARMOR_PATH'] = PYARMOR_PATH
sys.path.insert(0, PYARMOR_PATH)
from config import version, config_filename, capsule_filename
from project import Pr... | true | true |
f7501074cad963a9b913aa7127469a0b2a72f75a | 1,470 | py | Python | azure/mgmt/network/v2016_09_01/models/express_route_circuit_sku.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2022-01-25T22:52:58.000Z | 2022-01-25T22:52:58.000Z | azure/mgmt/network/v2016_09_01/models/express_route_circuit_sku.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | azure/mgmt/network/v2016_09_01/models/express_route_circuit_sku.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | # 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 ... | 36.75 | 79 | 0.608163 |
from msrest.serialization import Model
class ExpressRouteCircuitSku(Model):
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'tier': {'key': 'tier', 'type': 'str'},
'family': {'key': 'family', 'type': 'str'},
}
def __init__(self, name=None, tier=None, family=... | true | true |
f75010c9a0c67bc5f018b36ba9ab765c18ef06d9 | 468 | py | Python | app/models/common.py | ilya-goldin/kanban-board-app | 3c7026aedb0e21eaccc26a2ac4a37f0b6a91a122 | [
"MIT"
] | null | null | null | app/models/common.py | ilya-goldin/kanban-board-app | 3c7026aedb0e21eaccc26a2ac4a37f0b6a91a122 | [
"MIT"
] | null | null | null | app/models/common.py | ilya-goldin/kanban-board-app | 3c7026aedb0e21eaccc26a2ac4a37f0b6a91a122 | [
"MIT"
] | null | null | null | import datetime
from pydantic import BaseModel, Field, validator
class DateTimeModelMixin(BaseModel):
created_at: datetime.datetime = None
updated_at: datetime.datetime = None
@validator('created_at', 'updated_at', pre=True)
def default_datetime(
cls,
value: datetime.datetime... | 22.285714 | 52 | 0.681624 | import datetime
from pydantic import BaseModel, Field, validator
class DateTimeModelMixin(BaseModel):
created_at: datetime.datetime = None
updated_at: datetime.datetime = None
@validator('created_at', 'updated_at', pre=True)
def default_datetime(
cls,
value: datetime.datetime... | true | true |
f7501259c15280902a6f3ae33e990bbd04d27ee9 | 75 | py | Python | astropy_helpers/src/setup_package.py | migueldvb/astropy-helpers | 950358a24ce74be14a1679732bd8c94e6f5854d6 | [
"PSF-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2020-06-17T00:44:39.000Z | 2020-06-17T00:44:39.000Z | astropy_helpers/src/setup_package.py | fred3m/astropy-helpers | 19bb078dcd8c9dd08122da5c4b51f3703c3cc21c | [
"PSF-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | astropy_helpers/src/setup_package.py | fred3m/astropy-helpers | 19bb078dcd8c9dd08122da5c4b51f3703c3cc21c | [
"PSF-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | def get_package_data():
return {'astropy_helpers.src': ['compiler.c']}
| 25 | 50 | 0.693333 | def get_package_data():
return {'astropy_helpers.src': ['compiler.c']}
| true | true |
f750125bb9157e172c720c1027f7e13010d3d3e9 | 1,186 | py | Python | scripts/release.py | npapapietro/liesym | 56bce3290e35d111b86413191516c41a09f0a07d | [
"MIT"
] | 2 | 2021-09-09T22:25:25.000Z | 2022-01-22T01:15:47.000Z | scripts/release.py | npapapietro/liesym | 56bce3290e35d111b86413191516c41a09f0a07d | [
"MIT"
] | 1 | 2021-12-20T00:15:26.000Z | 2021-12-20T01:54:07.000Z | scripts/release.py | npapapietro/liesym | 56bce3290e35d111b86413191516c41a09f0a07d | [
"MIT"
] | 1 | 2021-09-09T22:25:31.000Z | 2021-09-09T22:25:31.000Z | import toml
from os.path import join, abspath, dirname
import sys
import re
root = abspath(join(dirname(__file__), ".."))
def update_cargo(ver):
path = join(root, "Cargo.toml")
raw = toml.load(path)
raw['package']['version'] = ver
with open(path, "w") as f:
toml.dump(raw, f)
def update_pypr... | 23.254902 | 55 | 0.559022 | import toml
from os.path import join, abspath, dirname
import sys
import re
root = abspath(join(dirname(__file__), ".."))
def update_cargo(ver):
path = join(root, "Cargo.toml")
raw = toml.load(path)
raw['package']['version'] = ver
with open(path, "w") as f:
toml.dump(raw, f)
def update_pypr... | true | true |
f750133d9a2d221a31e17d79bd21136c14e75480 | 851 | py | Python | ABC/007/c.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | ABC/007/c.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | ABC/007/c.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | from collections import deque
def main():
# input
R, C = map(int, input().split())
sy, sx = map(int, input().split())
gy, gx = map(int, input().split())
cs = [[*input()] for _ in range(R)]
# compute
sy -= 1
sx -= 1
gy -= 1
gx -= 1
deq = deque([[sy, sx]])
dist = [[-1 for... | 23.638889 | 62 | 0.437133 | from collections import deque
def main():
R, C = map(int, input().split())
sy, sx = map(int, input().split())
gy, gx = map(int, input().split())
cs = [[*input()] for _ in range(R)]
sy -= 1
sx -= 1
gy -= 1
gx -= 1
deq = deque([[sy, sx]])
dist = [[-1 for _ in range(C)] ... | true | true |
f75013447cfda6daa244ddc8e1641041939193e1 | 1,108 | py | Python | handsome/Interval.py | bracket/handsome | c93d34f94d0eea24f5514efc9bc423eb28b44a6b | [
"BSD-2-Clause"
] | null | null | null | handsome/Interval.py | bracket/handsome | c93d34f94d0eea24f5514efc9bc423eb28b44a6b | [
"BSD-2-Clause"
] | null | null | null | handsome/Interval.py | bracket/handsome | c93d34f94d0eea24f5514efc9bc423eb28b44a6b | [
"BSD-2-Clause"
] | null | null | null | __all__ = [ 'Interval' ]
class Interval(object):
'''Interval - Arbitrary half-closed interval of the form [start, end)'''
def __init__(self, start, end):
self.start = start
self.end = end
def __call__(self, value):
return (1. - value) * self.start + value * self.end
def __str... | 26.380952 | 76 | 0.58574 | __all__ = [ 'Interval' ]
class Interval(object):
def __init__(self, start, end):
self.start = start
self.end = end
def __call__(self, value):
return (1. - value) * self.start + value * self.end
def __str__(self):
return 'Interval({self.start}, {self.end})'.format(self=sel... | true | true |
f75013c9472413846dfe1c78484b25f6aeb3b67b | 12,599 | py | Python | src/python/pants/goal/run_tracker.py | square/pants | 28a018c7f47900aec4f576c81a52e0e4b41d9fec | [
"Apache-2.0"
] | 11 | 2015-01-20T01:39:41.000Z | 2019-08-08T07:27:44.000Z | src/python/pants/goal/run_tracker.py | fakeNetflix/square-repo-pants | 28a018c7f47900aec4f576c81a52e0e4b41d9fec | [
"Apache-2.0"
] | 1 | 2019-08-21T07:29:26.000Z | 2019-08-21T07:29:26.000Z | src/python/pants/goal/run_tracker.py | fakeNetflix/square-repo-pants | 28a018c7f47900aec4f576c81a52e0e4b41d9fec | [
"Apache-2.0"
] | 5 | 2015-03-30T02:46:53.000Z | 2018-03-08T20:10:43.000Z | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
import json
import o... | 39.371875 | 103 | 0.698309 |
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
import json
import os
import sys
import threading
import time
import urllib
from contextlib import contextmanager
from urlparse import urlparse
import httplib
fr... | true | true |
f75014d754991940e6394bd097ed253b34be69f7 | 26 | py | Python | shampoo_lite/shampoo_lite/__init__.py | dhm-org/dhm_suite | 19f803fbe973bebf9bd63994e58ea94f475ba3f6 | [
"Apache-2.0"
] | 4 | 2019-10-08T22:23:45.000Z | 2021-03-08T08:14:11.000Z | shampoo_lite/shampoo_lite/__init__.py | dhm-org/dhm_suite | 19f803fbe973bebf9bd63994e58ea94f475ba3f6 | [
"Apache-2.0"
] | 24 | 2019-06-18T21:57:32.000Z | 2020-10-13T21:39:53.000Z | shampoo_lite/shampoo_lite/__init__.py | dhm-org/dhm_suite | 19f803fbe973bebf9bd63994e58ea94f475ba3f6 | [
"Apache-2.0"
] | null | null | null | #from .datatypes import *
| 13 | 25 | 0.730769 | true | true | |
f750153448f74dd654e1cadf1dd4c391b2aedfaf | 12,692 | py | Python | src/tiden_gridgain/apps/mysql/mysql.py | mshonichev/tiden_gridgain | a1d8c4093efa9ce580c60be8071b8c3b7a2624ca | [
"Apache-2.0"
] | null | null | null | src/tiden_gridgain/apps/mysql/mysql.py | mshonichev/tiden_gridgain | a1d8c4093efa9ce580c60be8071b8c3b7a2624ca | [
"Apache-2.0"
] | null | null | null | src/tiden_gridgain/apps/mysql/mysql.py | mshonichev/tiden_gridgain | a1d8c4093efa9ce580c60be8071b8c3b7a2624ca | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from tiden.apps.app import App
from tiden.apps.nodestatus import NodeStatus
from tiden.util import *
class Mysql(App):
tmp_pwd_log_tag = "A temporary password is generated for root@localhost:"
account_tmpl = [
"CREATE USER '__USER__'@'__HOST__' IDENTIFIED BY '__PWD__';",
... | 38 | 113 | 0.451229 |
from tiden.apps.app import App
from tiden.apps.nodestatus import NodeStatus
from tiden.util import *
class Mysql(App):
tmp_pwd_log_tag = "A temporary password is generated for root@localhost:"
account_tmpl = [
"CREATE USER '__USER__'@'__HOST__' IDENTIFIED BY '__PWD__';",
"GRANT ALL PRIVILEG... | true | true |
f75016a45b21687519bd78a0347f80a480ada899 | 22,069 | py | Python | docshtest.py | vaab/docshtest | acefec308559d77e1f7940ae903fad9daa54057a | [
"BSD-2-Clause"
] | 3 | 2021-02-12T21:56:25.000Z | 2021-06-20T10:49:57.000Z | docshtest.py | vaab/docshtest | acefec308559d77e1f7940ae903fad9daa54057a | [
"BSD-2-Clause"
] | null | null | null | docshtest.py | vaab/docshtest | acefec308559d77e1f7940ae903fad9daa54057a | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Shell Doctest
"""
from __future__ import print_function
import re
import sys
import os.path
import difflib
import threading
import locale
from io import open
try:
from Queue import Queue, Empty
except ImportError:
from queue import Queue, Empty # python... | 31.039381 | 80 | 0.557207 |
from __future__ import print_function
import re
import sys
import os.path
import difflib
import threading
import locale
from io import open
try:
from Queue import Queue, Empty
except ImportError:
from queue import Queue, Empty
PY3 = sys.version_info[0] >= 3
WIN32 = sys.platform == 'win32'
EXNAME = ... | true | true |
f75017867371c16bc75e5ca1b98a0591c164b39e | 5,030 | py | Python | transmit.py | cawoodjm/AutoFT8 | 794bc03f663e97e10422dadfd0f221b2fd2859a0 | [
"BSD-3-Clause"
] | 7 | 2021-11-12T20:43:09.000Z | 2022-03-20T14:22:20.000Z | transmit.py | cawoodjm/AutoFT8 | 794bc03f663e97e10422dadfd0f221b2fd2859a0 | [
"BSD-3-Clause"
] | 1 | 2021-11-13T16:45:18.000Z | 2021-11-13T16:45:18.000Z | transmit.py | cawoodjm/AutoFT8 | 794bc03f663e97e10422dadfd0f221b2fd2859a0 | [
"BSD-3-Clause"
] | 5 | 2021-11-10T03:03:06.000Z | 2022-01-12T03:34:12.000Z | #
# BSD 3-Clause License
#
# Copyright (c) 2021, Fred W6BSD
# All rights reserved.
# See licence file for more information.
#
import logging
import operator
import re
import socket
import threading
import time
from datetime import datetime
from importlib import import_module
import wsjtx
from config import Config
L... | 25.663265 | 70 | 0.612922 |
import logging
import operator
import re
import socket
import threading
import time
from datetime import datetime
from importlib import import_module
import wsjtx
from config import Config
LOG = logging.getLogger('Transmit')
class Transmit(threading.Thread):
def __init__(self, status, period, daemon=Non... | true | true |
f75017a1f62ee6dacd96e2a242c62b4753f2579e | 2,240 | py | Python | day7/b.py | tehbone/advent2017 | 51640921c3199144bd89cfbfbb6c54f22c354888 | [
"Apache-2.0"
] | null | null | null | day7/b.py | tehbone/advent2017 | 51640921c3199144bd89cfbfbb6c54f22c354888 | [
"Apache-2.0"
] | null | null | null | day7/b.py | tehbone/advent2017 | 51640921c3199144bd89cfbfbb6c54f22c354888 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import sys
class InvalidWeightError(Exception):
def __init__(self, needed, actual):
super(InvalidWeightError, self).__init__()
self.needed = needed
self.actual = actual
class Program(object):
def __init__(self, desc):
super(Program, self).__init__()
i ... | 27.317073 | 72 | 0.471875 |
import sys
class InvalidWeightError(Exception):
def __init__(self, needed, actual):
super(InvalidWeightError, self).__init__()
self.needed = needed
self.actual = actual
class Program(object):
def __init__(self, desc):
super(Program, self).__init__()
i = desc.find(' ')
... | true | true |
f75017a8869a21bcb490d97f7afed0c47de8463c | 12,679 | py | Python | otter/test/rest/test_decorators.py | alex/otter | e46316634ae4c211f7436aa4d41321ac1edba0af | [
"Apache-2.0"
] | 1 | 2015-11-08T12:58:44.000Z | 2015-11-08T12:58:44.000Z | otter/test/rest/test_decorators.py | alex/otter | e46316634ae4c211f7436aa4d41321ac1edba0af | [
"Apache-2.0"
] | null | null | null | otter/test/rest/test_decorators.py | alex/otter | e46316634ae4c211f7436aa4d41321ac1edba0af | [
"Apache-2.0"
] | null | null | null | """
Unit tests for the fault system
"""
from cStringIO import StringIO
import json
import mock
from jsonschema import ValidationError
from twisted.trial.unittest import TestCase
from twisted.internet import defer
from twisted.python.failure import Failure
from otter.rest.decorators import (
fails_with, select_d... | 32.84715 | 84 | 0.596656 |
from cStringIO import StringIO
import json
import mock
from jsonschema import ValidationError
from twisted.trial.unittest import TestCase
from twisted.internet import defer
from twisted.python.failure import Failure
from otter.rest.decorators import (
fails_with, select_dict, succeeds_with, validate_body, Inval... | true | true |
f75018e216521681bec1e7b89c12c3f46ed58a26 | 60,438 | py | Python | src/tequila/quantumchemistry/qc_base.py | kiminh/tequila | 464085265e125222c63e65446861e9c0a2428bab | [
"MIT"
] | 1 | 2021-01-11T18:40:47.000Z | 2021-01-11T18:40:47.000Z | src/tequila/quantumchemistry/qc_base.py | kiminh/tequila | 464085265e125222c63e65446861e9c0a2428bab | [
"MIT"
] | null | null | null | src/tequila/quantumchemistry/qc_base.py | kiminh/tequila | 464085265e125222c63e65446861e9c0a2428bab | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from tequila import TequilaException, BitString, TequilaWarning
from tequila.hamiltonian import QubitHamiltonian
from tequila.circuit import QCircuit, gates
from tequila.objective.objective import Variable, Variables, ExpectationValue
from tequila.simulators.simulator_api import simu... | 39.219987 | 143 | 0.545253 | from dataclasses import dataclass
from tequila import TequilaException, BitString, TequilaWarning
from tequila.hamiltonian import QubitHamiltonian
from tequila.circuit import QCircuit, gates
from tequila.objective.objective import Variable, Variables, ExpectationValue
from tequila.simulators.simulator_api import simu... | true | true |
f750191ca16b5507ab0d12f6cf19dc95810337d9 | 2,410 | py | Python | examples/threathunter/threat_intelligence/results.py | mtmcgrew/cbapi-python | 6e81507ff30a57eb1f13ae829c28e6ee339d2ad1 | [
"MIT"
] | null | null | null | examples/threathunter/threat_intelligence/results.py | mtmcgrew/cbapi-python | 6e81507ff30a57eb1f13ae829c28e6ee339d2ad1 | [
"MIT"
] | 1 | 2021-03-31T19:51:07.000Z | 2021-03-31T19:51:07.000Z | examples/threathunter/threat_intelligence/results.py | deepakmishraapi/cbresponse | 420fa05d0f7b9d61e5682d7a69a4098f6c32e61c | [
"MIT"
] | null | null | null | import enum
import logging
class IOC_v2():
"""Models an indicator of compromise detected during an analysis.
Every IOC belongs to an AnalysisResult.
"""
def __init__(self, analysis, match_type, values, field, link):
self.id = analysis
self.match_type = match_type
self.values ... | 30.897436 | 115 | 0.589627 | import enum
import logging
class IOC_v2():
def __init__(self, analysis, match_type, values, field, link):
self.id = analysis
self.match_type = match_type
self.values = values
self.field = field
self.link = link
class MatchType(str, enum.Enum):
Equality: str =... | true | true |
f75019f0a76d4b8a3bdd02713392107ba45a03cb | 8,010 | py | Python | kubernetes/client/models/io_xk8s_cluster_addons_v1alpha4_cluster_resource_set_binding_list.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/io_xk8s_cluster_addons_v1alpha4_cluster_resource_set_binding_list.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/io_xk8s_cluster_addons_v1alpha4_cluster_resource_set_binding_list.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.20.7
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
fr... | 38.883495 | 312 | 0.672659 |
import pprint
import re
import six
from kubernetes.client.configuration import Configuration
class IoXK8sClusterAddonsV1alpha4ClusterResourceSetBindingList(object):
openapi_types = {
'api_version': 'str',
'items': 'list[IoXK8sClusterAddonsV1alpha4ClusterResourceSetBinding]',
'kind... | true | true |
f7501c2debcabcb28561690ba54da0e544d722a1 | 672 | py | Python | pipedrive/migrations/0008_auto_20170530_1548.py | MasAval/django_pipedrive | b5b4df63f2585231dbd710779e242fe3a4e12dc7 | [
"BSD-3-Clause"
] | 5 | 2017-04-28T19:00:35.000Z | 2021-02-23T19:49:14.000Z | pipedrive/migrations/0008_auto_20170530_1548.py | MasAval/django_pipedrive | b5b4df63f2585231dbd710779e242fe3a4e12dc7 | [
"BSD-3-Clause"
] | 21 | 2017-05-01T04:11:55.000Z | 2021-06-10T18:10:10.000Z | pipedrive/migrations/0008_auto_20170530_1548.py | MasAval/django_pipedrive | b5b4df63f2585231dbd710779e242fe3a4e12dc7 | [
"BSD-3-Clause"
] | 5 | 2017-09-04T02:35:56.000Z | 2021-05-06T09:09:46.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import pipedrive.fields
class Migration(migrations.Migration):
dependencies = [
('pipedrive', '0007_auto_20170519_0052'),
]
operations = [
migrations.AddField(
model_name... | 25.846154 | 106 | 0.616071 |
from __future__ import unicode_literals
from django.db import migrations, models
import pipedrive.fields
class Migration(migrations.Migration):
dependencies = [
('pipedrive', '0007_auto_20170519_0052'),
]
operations = [
migrations.AddField(
model_name='deal',
na... | true | true |
f7501c2fe38873d868de98099e873729edb8b561 | 4,212 | py | Python | tests/instruments/test_validators.py | HansMalo/pymeasure | b4d888e9ead85ef7f7af0031f2dbb44c9ce1825e | [
"MIT"
] | 153 | 2020-11-12T17:01:31.000Z | 2022-03-29T09:54:38.000Z | tests/instruments/test_validators.py | HansMalo/pymeasure | b4d888e9ead85ef7f7af0031f2dbb44c9ce1825e | [
"MIT"
] | 226 | 2020-11-12T07:36:11.000Z | 2022-03-22T08:18:26.000Z | tests/instruments/test_validators.py | HansMalo/pymeasure | b4d888e9ead85ef7f7af0031f2dbb44c9ce1825e | [
"MIT"
] | 85 | 2020-11-15T03:41:28.000Z | 2022-03-25T07:14:18.000Z | #
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2021 PyMeasure Developers
#
# 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 limit... | 39.735849 | 79 | 0.709639 |
import pytest
from pymeasure.instruments.validators import (
strict_range, strict_discrete_range, strict_discrete_set,
truncated_range, truncated_discrete_set,
modular_range, modular_range_bidirectional,
joined_validators
)
def test_strict_range():
assert strict_range(5, ra... | true | true |
f7501c4be972a9373c80776d771123cd5fdde035 | 1,310 | py | Python | piprot/providers/github.py | ziima/piprot | f94014fbd5a9f3469604b1fa21d63cef6d95a695 | [
"MIT"
] | null | null | null | piprot/providers/github.py | ziima/piprot | f94014fbd5a9f3469604b1fa21d63cef6d95a695 | [
"MIT"
] | 2 | 2019-11-18T07:47:10.000Z | 2019-11-20T09:33:15.000Z | piprot/providers/github.py | ziima/piprot | f94014fbd5a9f3469604b1fa21d63cef6d95a695 | [
"MIT"
] | null | null | null | """Functions to interact with github API."""
import json
import re
from io import StringIO
import requests
GITHUB_API_BASE = 'https://api.github.com'
def build_github_url(
repo,
branch=None,
path='requirements.txt',
token=None
):
"""Builds a URL to a file inside a Github repository."""
repo ... | 23.392857 | 66 | 0.633588 | import json
import re
from io import StringIO
import requests
GITHUB_API_BASE = 'https://api.github.com'
def build_github_url(
repo,
branch=None,
path='requirements.txt',
token=None
):
repo = re.sub(r"^http(s)?://github.com/", "", repo).strip('/')
if not path:
path = 'requireme... | true | true |
f7501c61144a4776d10efb205f9badd627e9dca2 | 917 | py | Python | app/main/routes.py | candicecz/conp-portal | 1685a833195b1a4755203a482cebd81644c94a6e | [
"MIT"
] | null | null | null | app/main/routes.py | candicecz/conp-portal | 1685a833195b1a4755203a482cebd81644c94a6e | [
"MIT"
] | null | null | null | app/main/routes.py | candicecz/conp-portal | 1685a833195b1a4755203a482cebd81644c94a6e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" Routes Module
Currently this module contains all of the routes for the main blueprint
"""
from flask import render_template
from flask_login import current_user, login_required
from app.main import main_bp
@main_bp.route('/')
@main_bp.route('/public')
def public():
"""Public Route... | 21.833333 | 84 | 0.643402 |
from flask import render_template
from flask_login import current_user, login_required
from app.main import main_bp
@main_bp.route('/')
@main_bp.route('/public')
def public():
return render_template('public.html', title='Home | CONP')
@main_bp.route('/index')
@login_required
def index():
if current_user.is... | true | true |
f7501cd60de40964a916f895d6b0242f94e54f05 | 6,163 | py | Python | internal/twirptest/snake_case_names/snake_case_names_pb2.py | furdarius/twirp | 59f3b78c016b51e99bdbf7e852ed3d87540ddd2b | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-07-11T23:20:19.000Z | 2021-05-27T22:20:29.000Z | internal/twirptest/snake_case_names/snake_case_names_pb2.py | mrdecafee/twirp | 337e90237d72193bf7f9fa387b5b9946436b7733 | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2019-10-01T15:19:32.000Z | 2020-05-28T14:48:55.000Z | internal/twirptest/snake_case_names/snake_case_names_pb2.py | mrdecafee/twirp | 337e90237d72193bf7f9fa387b5b9946436b7733 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: snake_case_names.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection ... | 34.049724 | 538 | 0.767483 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google... | true | true |
f7501dc4377d083765fbc805849994e61fb1a19b | 7,650 | py | Python | sdk/python/pulumi_azure_native/network/v20200301/get_local_network_gateway.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20200301/get_local_network_gateway.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20200301/get_local_network_gateway.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 36.428571 | 229 | 0.652418 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetLocalNetworkGatewayResult',
'AwaitableGetLocalNetworkGatewayResult',
'get_local_network_gateway',
]
@pulumi.output_ty... | true | true |
f7501e3a99aa5792cbe2aa9ef901bd6804b0839c | 1,084 | py | Python | templates/filters.py | Godkayaki/tfg_devnet_automation | f3be155b3a21c3e0c624eb2b0d7b423d754c8c4d | [
"MIT"
] | null | null | null | templates/filters.py | Godkayaki/tfg_devnet_automation | f3be155b3a21c3e0c624eb2b0d7b423d754c8c4d | [
"MIT"
] | null | null | null | templates/filters.py | Godkayaki/tfg_devnet_automation | f3be155b3a21c3e0c624eb2b0d7b423d754c8c4d | [
"MIT"
] | 1 | 2021-06-18T12:07:21.000Z | 2021-06-18T12:07:21.000Z | #!/usr/bin/python3
#-*- coding: utf-8 -*-
#Daniel Gonzalez
# full filter
full_filter = '''
<filter>
<native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native">
</native>
</filter>
'''
# Create a configuration filter
interface_filter = '''
<filter>
<native xmlns="http://cisco.com/... | 23.06383 | 73 | 0.45941 |
full_filter = '''
<filter>
<native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native">
</native>
</filter>
'''
interface_filter = '''
<filter>
<native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native">
<interface>
<GigabitEthernet>
... | true | true |
f7501e79bbc42bededce5bd6b628d12a828edfb9 | 15,063 | py | Python | allennlp/modules/elmo_lstm.py | justindujardin/allennlp | c4559f3751775aa8bc018db417edc119d29d8051 | [
"Apache-2.0"
] | 2 | 2021-04-27T19:56:28.000Z | 2021-08-19T05:34:37.000Z | allennlp/modules/elmo_lstm.py | justindujardin/allennlp | c4559f3751775aa8bc018db417edc119d29d8051 | [
"Apache-2.0"
] | 5 | 2021-05-03T14:40:33.000Z | 2021-05-03T14:40:34.000Z | allennlp/modules/elmo_lstm.py | justindujardin/allennlp | c4559f3751775aa8bc018db417edc119d29d8051 | [
"Apache-2.0"
] | 1 | 2020-03-01T13:01:34.000Z | 2020-03-01T13:01:34.000Z | """
A stacked bidirectional LSTM with skip connections between layers.
"""
from typing import Optional, Tuple, List
import warnings
import torch
from torch.nn.utils.rnn import PackedSequence, pad_packed_sequence
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=FutureWarning)
import h... | 46.205521 | 99 | 0.621988 | from typing import Optional, Tuple, List
import warnings
import torch
from torch.nn.utils.rnn import PackedSequence, pad_packed_sequence
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=FutureWarning)
import h5py
import numpy
from allennlp.modules.lstm_cell_with_projection import Ls... | true | true |
f7501e9800b71b579e2fd3b0a5d8ae8dd0993633 | 4,281 | py | Python | timetable/migrations/0001_initial.py | hyeonjang/class_schedule_maker | f04214fbc82774a9a8645cd2e2ee31e2b2d28df5 | [
"MIT"
] | null | null | null | timetable/migrations/0001_initial.py | hyeonjang/class_schedule_maker | f04214fbc82774a9a8645cd2e2ee31e2b2d28df5 | [
"MIT"
] | 4 | 2021-04-08T19:37:28.000Z | 2021-09-22T19:31:21.000Z | timetable/migrations/0001_initial.py | hyeonjang/class_schedule_maker | f04214fbc82774a9a8645cd2e2ee31e2b2d28df5 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-10-15 01:08
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('school', '0001_initial'),
migratio... | 58.643836 | 178 | 0.624153 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('school', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODE... | true | true |
f7501ec669a73a5f35e8838f556629f83e502b20 | 8,881 | py | Python | pygef/robertson/tests.py | cemsbv/pygef | e83811744328778bbfc808424121bbf3a64e3ff1 | [
"MIT"
] | 3 | 2021-11-10T09:44:01.000Z | 2022-02-01T07:55:03.000Z | pygef/robertson/tests.py | cemsbv/pygef | e83811744328778bbfc808424121bbf3a64e3ff1 | [
"MIT"
] | 79 | 2021-10-11T13:40:12.000Z | 2022-03-31T10:26:47.000Z | pygef/robertson/tests.py | cemsbv/pygef | e83811744328778bbfc808424121bbf3a64e3ff1 | [
"MIT"
] | 4 | 2021-11-25T13:38:30.000Z | 2022-02-18T10:27:58.000Z | import unittest
import numpy as np
import polars as pl
import pygef.robertson.util as util
import pygef.expressions as exprs
class RobertsonTest(unittest.TestCase):
def test_n_exponent(self):
df1 = pl.DataFrame(
{
"type_index_n": [1.0, 1.0, 1.0],
"effective_soi... | 34.289575 | 80 | 0.426641 | import unittest
import numpy as np
import polars as pl
import pygef.robertson.util as util
import pygef.expressions as exprs
class RobertsonTest(unittest.TestCase):
def test_n_exponent(self):
df1 = pl.DataFrame(
{
"type_index_n": [1.0, 1.0, 1.0],
"effective_soi... | true | true |
f7501f7c2f141a9ba917b84ba8194ea961cc0fbd | 362 | py | Python | config.py | olszewskik/Flask-basic-application-template | be3a4fd754a65c951515950663634c1d06a359f2 | [
"MIT"
] | null | null | null | config.py | olszewskik/Flask-basic-application-template | be3a4fd754a65c951515950663634c1d06a359f2 | [
"MIT"
] | null | null | null | config.py | olszewskik/Flask-basic-application-template | be3a4fd754a65c951515950663634c1d06a359f2 | [
"MIT"
] | null | null | null | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
@staticmethod
def init_app(app):
pass
class DevConfig(Config):
DEBUG = True
class TestConfig(Config):
pass
class LiveConfig(Config):
pass
config = {
'dev': DevConfig,
'test': TestConfig,
'live... | 12.066667 | 52 | 0.638122 | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
@staticmethod
def init_app(app):
pass
class DevConfig(Config):
DEBUG = True
class TestConfig(Config):
pass
class LiveConfig(Config):
pass
config = {
'dev': DevConfig,
'test': TestConfig,
'live... | true | true |
f7501f9ba404e8efcee17bc15a9901ed269dcbb4 | 1,038 | py | Python | passpie/utils.py | bcfurtado/passpie | 421c40a57ad5f55e3f14b323c929a2c41dfb5527 | [
"MIT"
] | 700 | 2015-05-02T20:58:37.000Z | 2022-01-20T18:49:17.000Z | passpie/utils.py | bcfurtado/passpie | 421c40a57ad5f55e3f14b323c929a2c41dfb5527 | [
"MIT"
] | 108 | 2015-05-02T02:56:39.000Z | 2021-07-01T21:46:10.000Z | passpie/utils.py | bcfurtado/passpie | 421c40a57ad5f55e3f14b323c929a2c41dfb5527 | [
"MIT"
] | 72 | 2015-05-03T02:50:24.000Z | 2021-06-09T03:38:51.000Z | from contextlib import contextmanager
import errno
import os
import re
from random import SystemRandom
import tempfile
from rstr import Rstr
from ._compat import which
rstr = Rstr(SystemRandom())
import_module = __import__
def genpass(pattern=r'[\w]{32}'):
"""generates a password with random chararcters
... | 18.872727 | 73 | 0.644509 | from contextlib import contextmanager
import errno
import os
import re
from random import SystemRandom
import tempfile
from rstr import Rstr
from ._compat import which
rstr = Rstr(SystemRandom())
import_module = __import__
def genpass(pattern=r'[\w]{32}'):
try:
return rstr.xeger(pattern)
except r... | true | true |
f750203788d3a1a00a7073ddd7e7d6808e919548 | 1,158 | py | Python | seisflows/postprocess/total_variation.py | chukren/seisflows | c4a5a8a9411b365c9bba818f6ed3ba03f24e681b | [
"BSD-2-Clause"
] | 1 | 2017-08-31T09:11:39.000Z | 2017-08-31T09:11:39.000Z | seisflows/postprocess/total_variation.py | chukren/seisflows | c4a5a8a9411b365c9bba818f6ed3ba03f24e681b | [
"BSD-2-Clause"
] | null | null | null | seisflows/postprocess/total_variation.py | chukren/seisflows | c4a5a8a9411b365c9bba818f6ed3ba03f24e681b | [
"BSD-2-Clause"
] | 1 | 2020-04-16T08:38:49.000Z | 2020-04-16T08:38:49.000Z |
import numpy as np
from seisflows.tools import unix
from seisflows.tools.array import loadnpy, savenpy
from seisflows.tools.array import grid2mesh, mesh2grid, stack
from seisflows.tools.code import exists
from seisflows.tools.config import SeisflowsParameters, SeisflowsPaths, \
ParameterError, custom_import
from ... | 25.733333 | 79 | 0.67962 |
import numpy as np
from seisflows.tools import unix
from seisflows.tools.array import loadnpy, savenpy
from seisflows.tools.array import grid2mesh, mesh2grid, stack
from seisflows.tools.code import exists
from seisflows.tools.config import SeisflowsParameters, SeisflowsPaths, \
ParameterError, custom_import
from ... | true | true |
f75021e253cf4c3c31cc351c064ebaa16f475634 | 5,668 | py | Python | ocfweb/account/chpass.py | ocf/new-website | 612162c1e8d65855b6659afde31ff77e4f370902 | [
"Apache-2.0",
"CC-BY-4.0"
] | 36 | 2015-08-25T07:57:38.000Z | 2022-03-22T21:17:53.000Z | ocfweb/account/chpass.py | ocf/new-website | 612162c1e8d65855b6659afde31ff77e4f370902 | [
"Apache-2.0",
"CC-BY-4.0"
] | 478 | 2015-08-31T05:05:49.000Z | 2022-03-12T00:56:52.000Z | ocfweb/account/chpass.py | ocf/new-website | 612162c1e8d65855b6659afde31ff77e4f370902 | [
"Apache-2.0",
"CC-BY-4.0"
] | 101 | 2015-09-16T04:14:42.000Z | 2022-01-15T20:44:29.000Z | from typing import Any
from typing import Iterator
from typing import List
from django import forms
from django.http import HttpRequest
from django.http import HttpResponse
from django.shortcuts import render
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from ocflib.... | 31.842697 | 100 | 0.625618 | from typing import Any
from typing import Iterator
from typing import List
from django import forms
from django.http import HttpRequest
from django.http import HttpResponse
from django.shortcuts import render
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from ocflib.... | true | true |
f750225ed8f757d86e461393a12fd12f010d00b4 | 10,125 | py | Python | vta/tests/python/integration/test_benchmark_topi_conv2d_transpose.py | zhenlohuang/tvm | fd2e6d17120a79533852c6bb705429d9c7bc286b | [
"Apache-2.0"
] | 40 | 2021-06-14T23:14:46.000Z | 2022-03-21T14:32:23.000Z | vta/tests/python/integration/test_benchmark_topi_conv2d_transpose.py | zhenlohuang/tvm | fd2e6d17120a79533852c6bb705429d9c7bc286b | [
"Apache-2.0"
] | 14 | 2021-06-08T03:15:54.000Z | 2022-02-01T23:50:24.000Z | vta/tests/python/integration/test_benchmark_topi_conv2d_transpose.py | zhenlohuang/tvm | fd2e6d17120a79533852c6bb705429d9c7bc286b | [
"Apache-2.0"
] | 11 | 2021-06-14T05:56:18.000Z | 2022-02-27T06:52:07.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.196721 | 98 | 0.603062 |
import json
import os
import pytest
import numpy as np
from collections import namedtuple
import tvm
from tvm import te
from tvm import relay
from tvm import autotvm
from tvm.contrib import utils
from tvm.contrib.pickle_memoize import memoize
from tvm import topi
import tvm.topi.testing
import vta
f... | true | true |
f750227f838437d46fab7e452afa20fbfef94d31 | 3,358 | py | Python | Budget_App.py | artthedeath/Estudo-em-Python | c9f6a13b6f6ebe605f44d9f916e9a0e910e0838f | [
"MIT"
] | null | null | null | Budget_App.py | artthedeath/Estudo-em-Python | c9f6a13b6f6ebe605f44d9f916e9a0e910e0838f | [
"MIT"
] | null | null | null | Budget_App.py | artthedeath/Estudo-em-Python | c9f6a13b6f6ebe605f44d9f916e9a0e910e0838f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 27 10:49:39 2020
@author: Arthur Donizeti Rodrigues Dias
"""
class Category:
def __init__(self, categories):
self.ledger=[]
self.categories = categories
self.listaDeposito=[]
self.listaRetirada=[]
self.total_entr... | 27.752066 | 85 | 0.467838 |
class Category:
def __init__(self, categories):
self.ledger=[]
self.categories = categories
self.listaDeposito=[]
self.listaRetirada=[]
self.total_entrada = 0
self.total_saida = 0
def __str__(self):
x = self.categories.center(30,"*")+'\... | true | true |
f75022abbfbda4f5891538a895944d0b37776025 | 9,810 | py | Python | skimage/morphology/selem.py | jaidevd/scikit-image | 62d6a3d7e95a228c729c9ff99b4f45336a210885 | [
"BSD-3-Clause"
] | null | null | null | skimage/morphology/selem.py | jaidevd/scikit-image | 62d6a3d7e95a228c729c9ff99b4f45336a210885 | [
"BSD-3-Clause"
] | null | null | null | skimage/morphology/selem.py | jaidevd/scikit-image | 62d6a3d7e95a228c729c9ff99b4f45336a210885 | [
"BSD-3-Clause"
] | null | null | null | """
:author: Damian Eads, 2009
:license: modified BSD
"""
import numpy as np
from scipy import ndimage
from skimage import draw
def square(width, dtype=np.uint8):
"""Generates a flat, square-shaped structuring element.
Every pixel along the perimeter has a chessboard distance
no greater than radius (radi... | 26.950549 | 78 | 0.593884 |
import numpy as np
from scipy import ndimage
from skimage import draw
def square(width, dtype=np.uint8):
return np.ones((width, width), dtype=dtype)
def rectangle(width, height, dtype=np.uint8):
return np.ones((width, height), dtype=dtype)
def diamond(radius, dtype=np.uint8):
L = np.arange(0, radius *... | true | true |
f75022abcf42bffb36e4af0bc8501a6897fbf344 | 3,733 | py | Python | DB/Repositorio_Pernoctaciones_INE.py | SergioCMDev/Busines-Inteligence-applied-to-tourism | 61834a46fce22453e94b7bbdf8d4ecdcf128285a | [
"Apache-2.0"
] | null | null | null | DB/Repositorio_Pernoctaciones_INE.py | SergioCMDev/Busines-Inteligence-applied-to-tourism | 61834a46fce22453e94b7bbdf8d4ecdcf128285a | [
"Apache-2.0"
] | null | null | null | DB/Repositorio_Pernoctaciones_INE.py | SergioCMDev/Busines-Inteligence-applied-to-tourism | 61834a46fce22453e94b7bbdf8d4ecdcf128285a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Jun 25 12:50:46 2017
@author: Sergio Cristauro Manzano
"""
from ..DB.MySQL_INE import MySQLAccessINE as DBContext #Server
#from self.db.MySQL import MySQLAccess as DBContext #Local
class RepositoryPernoctacionesINE():
###########################################... | 54.897059 | 169 | 0.628181 |
from ..DB.MySQL_INE import MySQLAccessINE as DBContext
s RepositoryPernoctacionesINE():
| true | true |
f7502432d1092f6ce85918446c2d830567d52e67 | 6,506 | py | Python | lunavl/sdk/faceengine/engine.py | DeusAnimo/lunasdk | 3d06968ddc6177b330454cfc53116ece393b486d | [
"MIT"
] | 1 | 2020-04-07T03:53:54.000Z | 2020-04-07T03:53:54.000Z | lunavl/sdk/faceengine/engine.py | DeusAnimo/lunasdk | 3d06968ddc6177b330454cfc53116ece393b486d | [
"MIT"
] | null | null | null | lunavl/sdk/faceengine/engine.py | DeusAnimo/lunasdk | 3d06968ddc6177b330454cfc53116ece393b486d | [
"MIT"
] | null | null | null | """Module realize wraps on facengine objects
"""
import os
from typing import Optional, Union
import FaceEngine as CoreFE # pylint: disable=E0611,E0401
from lunavl.sdk.estimators.face_estimators.ags import AGSEstimator
from lunavl.sdk.estimators.face_estimators.basic_attributes import BasicAttributesEstimator
from l... | 34.42328 | 116 | 0.680141 | import os
from typing import Optional, Union
import FaceEngine as CoreFE
from lunavl.sdk.estimators.face_estimators.ags import AGSEstimator
from lunavl.sdk.estimators.face_estimators.basic_attributes import BasicAttributesEstimator
from lunavl.sdk.estimators.face_estimators.emotions import EmotionsEstimator
from lu... | true | true |
f75026e241f9312a050f0608872be46a844ad703 | 4,927 | py | Python | lifecycle/data/common/db.py | mF2C/LifecycleManagement | a9661c6dcaad94564c3e00d6059b9c0713b3f3c0 | [
"Apache-2.0"
] | null | null | null | lifecycle/data/common/db.py | mF2C/LifecycleManagement | a9661c6dcaad94564c3e00d6059b9c0713b3f3c0 | [
"Apache-2.0"
] | 18 | 2017-10-25T08:17:24.000Z | 2019-12-10T08:43:45.000Z | lifecycle/data/common/db.py | mF2C/LifecycleManagement | a9661c6dcaad94564c3e00d6059b9c0713b3f3c0 | [
"Apache-2.0"
] | null | null | null | """
db: pydblite (https://pydblite.readthedocs.io)
This is being developed for the MF2C Project: http://www.mf2c-project.eu/
Copyright: Roi Sucasas Font, Atos Research and Innovation, 2017.
This code is licensed under an Apache 2.0 license. Please, refer to the LICENSE.TXT file for more information
Created on 09 feb... | 33.517007 | 136 | 0.658413 |
import config
from lifecycle.logs import LOG
from pydblite.pydblite import Base
from lifecycle.common import TRACE
DB_DOCKER_PORTS = None
SERVICE_INSTANCES_LIST = []
def init():
global DB_DOCKER_PORTS
global SERVICE_INSTANCES_LIST
try:
LOG.info('[lifecycle.data.app.db] [init] Initia... | true | true |
f750272d27fdf8db39901e7219cb814bb63045ed | 1,243 | py | Python | pageobjects/cart_po.py | rxse/python-demoshop | b7b8c2ef59a63350433c9d50b4730c7344cbbcc6 | [
"MIT"
] | null | null | null | pageobjects/cart_po.py | rxse/python-demoshop | b7b8c2ef59a63350433c9d50b4730c7344cbbcc6 | [
"MIT"
] | null | null | null | pageobjects/cart_po.py | rxse/python-demoshop | b7b8c2ef59a63350433c9d50b4730c7344cbbcc6 | [
"MIT"
] | null | null | null | # Ranorex Webtestit Page Object File
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from pageobjects.checkout_po import CheckoutPo
# Additional data: {"img... | 32.710526 | 85 | 0.711987 |
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from pageobjects.checkout_po import CheckoutPo
class CartPo:
_proceed_to_checkout = (By.CSS_SELEC... | true | true |
f7502785417c50a3ee3ee08625fd4f87229eea55 | 1,068 | py | Python | events/contribution/report/contribution_summary_report/contribution_summary_report.py | bobzz-zone/korecent_gias | 4d456c6a4455b247cd6710f55bd7ebd30a615093 | [
"MIT"
] | null | null | null | events/contribution/report/contribution_summary_report/contribution_summary_report.py | bobzz-zone/korecent_gias | 4d456c6a4455b247cd6710f55bd7ebd30a615093 | [
"MIT"
] | null | null | null | events/contribution/report/contribution_summary_report/contribution_summary_report.py | bobzz-zone/korecent_gias | 4d456c6a4455b247cd6710f55bd7ebd30a615093 | [
"MIT"
] | null | null | null | # Copyright (c) 2013, bobzz.zone@gmail.com and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
def execute(filters=None):
columns, data = ["Item:link/Item:200","Total Qty:Float:100","Qty Percent:Percent:100","Total Sales... | 46.434783 | 199 | 0.720974 |
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
def execute(filters=None):
columns, data = ["Item:link/Item:200","Total Qty:Float:100","Qty Percent:Percent:100","Total Sales:Currency:200","Sales Percent:Percent:100","Total Cost:Currency:200","Cost Percent:Percent:100"], []
result... | true | true |
f75028076d8e08f6e716de33ad81fae0926788ea | 2,524 | py | Python | jnt/freq.py | shan18/taxi | 286e2c9a97c1e0b52d63bbb3508045001f449714 | [
"Apache-2.0"
] | 20 | 2019-01-31T18:22:34.000Z | 2022-02-11T18:59:01.000Z | jnt/freq.py | uhh-lt/taxi | 0abc016ff854cf3ebeff61be76acf10b7d6a67a7 | [
"Apache-2.0"
] | 7 | 2018-06-20T12:33:49.000Z | 2018-08-27T09:30:34.000Z | jnt/freq.py | shan18/taxi | 286e2c9a97c1e0b52d63bbb3508045001f449714 | [
"Apache-2.0"
] | 9 | 2016-04-02T17:01:00.000Z | 2018-09-01T18:13:22.000Z | from pandas import read_csv
import _pickle as pickle
from traceback import format_exc
from .common import exists, preprocess_pandas_csv
from .common import try_remove
DEFAULT_FREQ = 1
def load_freq(freq_fpath, min_freq=1, preprocess=True, sep='\t', strip_pos=True, use_pickle=True):
f = FreqDictionary(freq_fpat... | 34.575342 | 129 | 0.572504 | from pandas import read_csv
import _pickle as pickle
from traceback import format_exc
from .common import exists, preprocess_pandas_csv
from .common import try_remove
DEFAULT_FREQ = 1
def load_freq(freq_fpath, min_freq=1, preprocess=True, sep='\t', strip_pos=True, use_pickle=True):
f = FreqDictionary(freq_fpat... | true | true |
f750293b509722b8b17801ad19a45af380a7b992 | 7,030 | py | Python | dribdat/aggregation.py | fossabot/dribdat | 8731d3acab4aaad0a5053dc5cf18c8b4418c4f33 | [
"MIT"
] | null | null | null | dribdat/aggregation.py | fossabot/dribdat | 8731d3acab4aaad0a5053dc5cf18c8b4418c4f33 | [
"MIT"
] | null | null | null | dribdat/aggregation.py | fossabot/dribdat | 8731d3acab4aaad0a5053dc5cf18c8b4418c4f33 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Utilities for aggregating data
"""
from dribdat.user.models import Activity, Resource, User
from dribdat.user import isUserActive, projectProgressList
from dribdat.database import db
from dribdat.apifetch import * # TBR
def GetProjectData(url):
data = None
if url.find('//gitlab.com'... | 35.326633 | 95 | 0.621622 |
from dribdat.user.models import Activity, Resource, User
from dribdat.user import isUserActive, projectProgressList
from dribdat.database import db
from dribdat.apifetch import *
def GetProjectData(url):
data = None
if url.find('//gitlab.com') > 0:
apiurl = re.sub(r'https?://gitlab\.com/', '', url).... | true | true |
f7502950ca42840d3319e4e48813948e8ccce1ff | 1,381 | py | Python | tests/tests.py | File2Package/File2Package.backend.dpkg | 0f781789f44d82dee851ebee7f9245e255ef3af4 | [
"Unlicense"
] | null | null | null | tests/tests.py | File2Package/File2Package.backend.dpkg | 0f781789f44d82dee851ebee7f9245e255ef3af4 | [
"Unlicense"
] | null | null | null | tests/tests.py | File2Package/File2Package.backend.dpkg | 0f781789f44d82dee851ebee7f9245e255ef3af4 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
import sys
from pathlib import Path
from collections import OrderedDict
import unittest
from debparse.deb_control import parse as debParse
import psutil
import sh
dpkgS = sh.dpkg.bake("-S")
dpkgs = sh.dpkg.bake("-s")
thisFile = Path(__file__).absolute()
thisDir = thisFile.parent.absolute()
repo... | 26.056604 | 89 | 0.695148 |
import sys
from pathlib import Path
from collections import OrderedDict
import unittest
from debparse.deb_control import parse as debParse
import psutil
import sh
dpkgS = sh.dpkg.bake("-S")
dpkgs = sh.dpkg.bake("-s")
thisFile = Path(__file__).absolute()
thisDir = thisFile.parent.absolute()
repoMainDir = thisDir.pare... | true | true |
f75029d77896525a2b6ea6994a622e4b6855f4c7 | 581 | py | Python | setup.py | Abdellbar/qvidianapi | 17901ab870d9b9f26b9961fecab430521c2535f1 | [
"Apache-2.0"
] | null | null | null | setup.py | Abdellbar/qvidianapi | 17901ab870d9b9f26b9961fecab430521c2535f1 | [
"Apache-2.0"
] | null | null | null | setup.py | Abdellbar/qvidianapi | 17901ab870d9b9f26b9961fecab430521c2535f1 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
def readme():
with open('README.md') as f:
return f.read()
setup(name='qvidianapi',
version='0.1',
description='A Nice Python API to Qvidian.com',
long_description=readme(),
url='https://github.com/Abdellbar/qvidianapi',
author='Abdelbar Aglagan... | 24.208333 | 53 | 0.600688 | from setuptools import setup
def readme():
with open('README.md') as f:
return f.read()
setup(name='qvidianapi',
version='0.1',
description='A Nice Python API to Qvidian.com',
long_description=readme(),
url='https://github.com/Abdellbar/qvidianapi',
author='Abdelbar Aglagan... | true | true |
f7502a40c53059d32cf1b40134d318e793d00010 | 9,326 | bzl | Python | third_party/com_github_tensorflow_tensorflow/py/python_configure.bzl | soonhokong/dreal4 | 573e613560f5dce9ad54a2f685e060fe447310c7 | [
"Apache-2.0"
] | 104 | 2017-12-07T18:17:35.000Z | 2022-03-31T06:58:13.000Z | third_party/com_github_tensorflow_tensorflow/py/python_configure.bzl | martinjos/dlinear4 | c0569f49762393eab2cd5d8823db8decb3cbe15e | [
"Apache-2.0"
] | 250 | 2017-09-01T01:32:45.000Z | 2022-03-29T04:08:00.000Z | third_party/com_github_tensorflow_tensorflow/py/python_configure.bzl | martinjos/dlinear4 | c0569f49762393eab2cd5d8823db8decb3cbe15e | [
"Apache-2.0"
] | 16 | 2018-01-07T07:40:11.000Z | 2022-03-24T05:01:11.000Z | """Repository rule for Python autoconfiguration.
`python_configure` depends on the following environment variables:
* `PYTHON_BIN_PATH`: location of python binary.
* `PYTHON_LIB_PATH`: Location of python libraries.
"""
load(
"//third_party/com_github_tensorflow_tensorflow/remote_config:common.bzl",
"BAZEL_... | 35.06015 | 108 | 0.621488 |
load(
"//third_party/com_github_tensorflow_tensorflow/remote_config:common.bzl",
"BAZEL_SH",
"PYTHON_BIN_PATH",
"PYTHON_LIB_PATH",
"TF_PYTHON_CONFIG_REPO",
"auto_config_fail",
"config_repo_label",
"execute",
"get_bash_bin",
"get_host_environ",
"get_python_bin",
"is_windo... | true | true |
f7502b7977834b940eb8254c1609e7ff2905327f | 4,120 | py | Python | tests/remotes/hdfs.py | arthurcgusmao/dvc | dff27bb163419bd2f93acaa0906dfdee7359d9d6 | [
"Apache-2.0"
] | 1 | 2020-08-01T08:31:18.000Z | 2020-08-01T08:31:18.000Z | tests/remotes/hdfs.py | arthurcgusmao/dvc | dff27bb163419bd2f93acaa0906dfdee7359d9d6 | [
"Apache-2.0"
] | null | null | null | tests/remotes/hdfs.py | arthurcgusmao/dvc | dff27bb163419bd2f93acaa0906dfdee7359d9d6 | [
"Apache-2.0"
] | 1 | 2020-11-28T11:47:48.000Z | 2020-11-28T11:47:48.000Z | import locale
import os
import platform
import uuid
from contextlib import contextmanager
import pytest
from dvc.path_info import URLInfo
from .base import Base
class HDFS(Base, URLInfo): # pylint: disable=abstract-method
@contextmanager
def _hdfs(self):
import pyarrow
conn = pyarrow.hdfs... | 28.413793 | 78 | 0.619903 | import locale
import os
import platform
import uuid
from contextlib import contextmanager
import pytest
from dvc.path_info import URLInfo
from .base import Base
class HDFS(Base, URLInfo):
@contextmanager
def _hdfs(self):
import pyarrow
conn = pyarrow.hdfs.connect(self.host, self.port)
... | true | true |
f7502bd89138cb83aae3d524e9024abc1370b6ef | 1,857 | py | Python | server/service_application/views/uninstall/view.py | yseiren87/jellicleSpace | 10d693bbc04e6b89a7ce15d2dc9797cec2a553b7 | [
"Apache-2.0"
] | null | null | null | server/service_application/views/uninstall/view.py | yseiren87/jellicleSpace | 10d693bbc04e6b89a7ce15d2dc9797cec2a553b7 | [
"Apache-2.0"
] | 7 | 2021-03-19T04:47:00.000Z | 2021-09-22T19:10:46.000Z | server/service_application/views/uninstall/view.py | yseiren87/jellicleSpace | 10d693bbc04e6b89a7ce15d2dc9797cec2a553b7 | [
"Apache-2.0"
] | null | null | null | from rest_framework import mixins, generics
from rest_framework.response import Response
from service_user.exports import get_user_instance_with_token_id
from service_application.exports import get_app_instance_with_app_id
from service_application.models import UsingApplicationModel
from utils import log, ParameterKeys... | 35.037736 | 75 | 0.658051 | from rest_framework import mixins, generics
from rest_framework.response import Response
from service_user.exports import get_user_instance_with_token_id
from service_application.exports import get_app_instance_with_app_id
from service_application.models import UsingApplicationModel
from utils import log, ParameterKeys... | true | true |
f7502c4018eeafa676058dfc4f4870b12ec5fe30 | 160,408 | py | Python | tensorflow/python/ops/image_ops_test.py | Zwysilence/tensorflow | b55001be83da044bb21d539d433dec6231eaec55 | [
"Apache-2.0"
] | 3 | 2018-09-25T00:35:34.000Z | 2018-09-25T00:38:06.000Z | tensorflow/python/ops/image_ops_test.py | Zwysilence/tensorflow | b55001be83da044bb21d539d433dec6231eaec55 | [
"Apache-2.0"
] | 1 | 2018-09-04T07:44:56.000Z | 2018-09-04T07:44:56.000Z | tensorflow/python/ops/image_ops_test.py | Zwysilence/tensorflow | b55001be83da044bb21d539d433dec6231eaec55 | [
"Apache-2.0"
] | 2 | 2020-01-31T04:19:45.000Z | 2020-03-06T16:33:00.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... | 38.228789 | 81 | 0.63058 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import colorsys
import functools
import itertools
import math
import os
import time
import numpy as np
from six.moves import xrange
from tensorflow.core.protobuf import config_pb2
from tensor... | true | true |
f7502c8de7a6505a9d5511b4ef8258c785bdfc3e | 6,579 | py | Python | models/layers/norm_act.py | hmthanh/LaTeX_OCR | bf5cf4642aff9cbbd5c4f8f232cd993a38ee6d81 | [
"MIT"
] | null | null | null | models/layers/norm_act.py | hmthanh/LaTeX_OCR | bf5cf4642aff9cbbd5c4f8f232cd993a38ee6d81 | [
"MIT"
] | null | null | null | models/layers/norm_act.py | hmthanh/LaTeX_OCR | bf5cf4642aff9cbbd5c4f8f232cd993a38ee6d81 | [
"MIT"
] | null | null | null | from typing import Union, List
import torch
from torch import nn as nn
from torch.nn import functional as F
from models.layers.create_act import get_act_layer
from .trace_utils import _assert
class BatchNormAct2d(nn.BatchNorm2d):
"""BatchNorm + Activation
This module performs BatchNorm + Activation in a man... | 42.173077 | 115 | 0.631403 | from typing import Union, List
import torch
from torch import nn as nn
from torch.nn import functional as F
from models.layers.create_act import get_act_layer
from .trace_utils import _assert
class BatchNormAct2d(nn.BatchNorm2d):
def __init__(
self, num_features, eps=1e-5, momentum=0.1, affine=True... | true | true |
f7502c969243aad6d25af115cfa3b3bd0c5e6d84 | 638 | py | Python | obj_handling/read.py | BMaxV/obj_handling | 20f448f09fdadce24414efcb5cc71e3678920ed9 | [
"MIT"
] | null | null | null | obj_handling/read.py | BMaxV/obj_handling | 20f448f09fdadce24414efcb5cc71e3678920ed9 | [
"MIT"
] | null | null | null | obj_handling/read.py | BMaxV/obj_handling | 20f448f09fdadce24414efcb5cc71e3678920ed9 | [
"MIT"
] | null | null | null | def read(fn):
verts=[]
faces=[]
with open(fn,"r") as f:
t=f.readlines()
for line in t:
line=line.replace("\n","")
line=line.split(" ")
while "" in line:
line.remove("")
print([line])
if line[0]=="v":
vert=[]
for x i... | 22.785714 | 37 | 0.431034 | def read(fn):
verts=[]
faces=[]
with open(fn,"r") as f:
t=f.readlines()
for line in t:
line=line.replace("\n","")
line=line.split(" ")
while "" in line:
line.remove("")
print([line])
if line[0]=="v":
vert=[]
for x i... | true | true |
f7502cbbf0c8271c158e98913a3ad50f72bdd6a5 | 418 | py | Python | setup.py | uswitch/service-standard-python | db77747ef7237080e1600463c209b0d47d148f8c | [
"Apache-2.0"
] | null | null | null | setup.py | uswitch/service-standard-python | db77747ef7237080e1600463c209b0d47d148f8c | [
"Apache-2.0"
] | 1 | 2021-06-04T14:36:37.000Z | 2021-06-04T14:36:37.000Z | setup.py | uswitch/service-standard-python | db77747ef7237080e1600463c209b0d47d148f8c | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
setup(
name='service-standard-python',
version='0.2',
description='RVU Service Standard library for Python',
url='git@github.com:uswitch/service-standard-python.git',
author='Site Reliability Engineering',
author_email='sre@rvu.co.uk',
install_requires=['flask',... | 29.857143 | 64 | 0.715311 | from setuptools import setup
setup(
name='service-standard-python',
version='0.2',
description='RVU Service Standard library for Python',
url='git@github.com:uswitch/service-standard-python.git',
author='Site Reliability Engineering',
author_email='sre@rvu.co.uk',
install_requires=['flask',... | true | true |
f7502e56266002d4ac7a9f46471f8a6563a8f2c5 | 3,781 | py | Python | dataset.py | joycenerd/bird-images-classification | 9430f65ba22523809d62b3d84c3e40d8bc47111f | [
"MIT"
] | null | null | null | dataset.py | joycenerd/bird-images-classification | 9430f65ba22523809d62b3d84c3e40d8bc47111f | [
"MIT"
] | null | null | null | dataset.py | joycenerd/bird-images-classification | 9430f65ba22523809d62b3d84c3e40d8bc47111f | [
"MIT"
] | null | null | null | from torch.utils.data import Dataset, DataLoader
from torchvision import transforms
from PIL import Image
import torch.nn as nn
import numpy as np
import torch
from pathlib import Path
import collections
import numbers
import random
import os
class BirdDataset(Dataset):
def __init__(self, root_dir, mode, transfo... | 30.248 | 114 | 0.637133 | from torch.utils.data import Dataset, DataLoader
from torchvision import transforms
from PIL import Image
import torch.nn as nn
import numpy as np
import torch
from pathlib import Path
import collections
import numbers
import random
import os
class BirdDataset(Dataset):
def __init__(self, root_dir, mode, transfo... | true | true |
f7502ea10a3a0111d5b9fc8005ef12474f26da6c | 2,258 | py | Python | test/mac/gyptest-postbuild-fail.py | xforce/gyp | a079e0aeab3470d14055657bba75adaa94e974e6 | [
"BSD-3-Clause"
] | null | null | null | test/mac/gyptest-postbuild-fail.py | xforce/gyp | a079e0aeab3470d14055657bba75adaa94e974e6 | [
"BSD-3-Clause"
] | null | null | null | test/mac/gyptest-postbuild-fail.py | xforce/gyp | a079e0aeab3470d14055657bba75adaa94e974e6 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that a failing postbuild step lets the build fail.
"""
from __future__ import print_function
import TestGyp
import sys
if s... | 31.802817 | 76 | 0.648804 |
from __future__ import print_function
import TestGyp
import sys
if sys.platform == 'darwin':
test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'],
match = lambda a, b: True)
test.run_gyp('test.gyp', chdir='postbuild-fail')
build_error_code = {
'xcode': [1, 65],
... | true | true |
f7502fcf523680fd1c4316f2cb340e763a589071 | 414 | py | Python | setup.py | domdfcoding/tox-isolation | f9c1e5181956296e074bd94813978d9ae6039f19 | [
"MIT"
] | null | null | null | setup.py | domdfcoding/tox-isolation | f9c1e5181956296e074bd94813978d9ae6039f19 | [
"MIT"
] | 1 | 2021-03-29T20:42:33.000Z | 2022-01-16T23:49:56.000Z | setup.py | domdfcoding/tox-isolation | f9c1e5181956296e074bd94813978d9ae6039f19 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# This file is managed by 'repo_helper'. Don't edit it directly.
# stdlib
import sys
# 3rd party
from setuptools import setup
sys.path.append('.')
# this package
from __pkginfo__ import * # pylint: disable=wildcard-import
setup(
description="Runs pytest in isolation.",
extras_require=ext... | 18.818182 | 64 | 0.743961 |
# stdlib
import sys
# 3rd party
from setuptools import setup
sys.path.append('.')
# this package
from __pkginfo__ import * # pylint: disable=wildcard-import
setup(
description="Runs pytest in isolation.",
extras_require=extras_require,
install_requires=install_requires,
py_modules=[],
version=__versio... | true | true |
f7503060c36ce3f2100fa8657ee9a3343af78e32 | 1,101 | py | Python | tentacruel/pinger/run.py | paulhoule/tentacruel | 600f39157598b762226a1c07d78966981da5f7f9 | [
"MIT"
] | null | null | null | tentacruel/pinger/run.py | paulhoule/tentacruel | 600f39157598b762226a1c07d78966981da5f7f9 | [
"MIT"
] | 39 | 2019-01-12T00:00:48.000Z | 2019-05-08T02:06:36.000Z | tentacruel/pinger/run.py | paulhoule/tentacruel | 600f39157598b762226a1c07d78966981da5f7f9 | [
"MIT"
] | null | null | null | """
Pinger application. Periodically poll hosts to see if they are up. Log state in the
document database, but report state changes to the message Q
"""
from asyncio import run, get_event_loop, create_task
from aio_pika import ExchangeType, connect_robust
from tentacruel.config import get_config
from tentacruel.pi... | 25.022727 | 85 | 0.715713 | from asyncio import run, get_event_loop, create_task
from aio_pika import ExchangeType, connect_robust
from tentacruel.config import get_config
from tentacruel.pinger import ensure_proactor, Pinger
from tentacruel.pinger.hue_ping import hue_loop, protect
async def pika_connect(config):
connection = await connect... | true | true |
f750310624078a9a0836bfca13f381e5ceb770c3 | 1,216 | py | Python | lib/django-1.5/django/db/models/sql/constants.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/lib/django-1.5/django/db/models/sql/constants.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/lib/django-1.5/django/db/models/sql/constants.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | """
Constants specific to the SQL storage portion of the ORM.
"""
from collections import namedtuple
import re
# Valid query types (a set is used for speedy lookups). These are (currently)
# considered SQL-specific; other storage systems may choose to use different
# lookup types.
QUERY_TERMS = set([
'exact', 'ie... | 32.864865 | 79 | 0.671053 |
from collections import namedtuple
import re
QUERY_TERMS = set([
'exact', 'iexact', 'contains', 'icontains', 'gt', 'gte', 'lt', 'lte', 'in',
'startswith', 'istartswith', 'endswith', 'iendswith', 'range', 'year',
'month', 'day', 'week_day', 'isnull', 'search', 'regex', 'iregex',
])
GET_ITERATOR_CHUNK... | true | true |
f750311914ac13408cc082e58c36c2471e8f48be | 4,519 | py | Python | tools/wpt/revlist.py | CanonMukai/wpt | 378b84eb6e81d893a7c009cf8712aa46c2adbd9e | [
"BSD-3-Clause"
] | 8 | 2019-04-09T21:13:05.000Z | 2021-11-23T17:25:18.000Z | tools/wpt/revlist.py | CanonMukai/wpt | 378b84eb6e81d893a7c009cf8712aa46c2adbd9e | [
"BSD-3-Clause"
] | 7 | 2019-07-08T22:23:16.000Z | 2021-03-18T23:42:32.000Z | tools/wpt/revlist.py | CanonMukai/wpt | 378b84eb6e81d893a7c009cf8712aa46c2adbd9e | [
"BSD-3-Clause"
] | 11 | 2019-04-12T01:20:16.000Z | 2021-11-23T17:25:02.000Z | import argparse
import logging
import os
import time
from tools.wpt.testfiles import get_git_cmd
here = os.path.dirname(__file__)
wpt_root = os.path.abspath(os.path.join(here, os.pardir, os.pardir))
logger = logging.getLogger()
MYPY = False
if MYPY:
# MYPY is set to True when run under Mypy.
from typing impo... | 37.97479 | 78 | 0.595264 | import argparse
import logging
import os
import time
from tools.wpt.testfiles import get_git_cmd
here = os.path.dirname(__file__)
wpt_root = os.path.abspath(os.path.join(here, os.pardir, os.pardir))
logger = logging.getLogger()
MYPY = False
if MYPY:
from typing import Any
from typing import Dict
fro... | true | true |
f750327df36dbf88cabcf0a55cef2530254a6995 | 3,968 | py | Python | towhee/dag/graph_builder.py | yanliang567/towhee | b3d39dd11793244e655112b10bc15950c215d64a | [
"Apache-2.0"
] | 365 | 2021-07-13T09:21:46.000Z | 2022-03-31T19:54:30.000Z | towhee/dag/graph_builder.py | yanliang567/towhee | b3d39dd11793244e655112b10bc15950c215d64a | [
"Apache-2.0"
] | 911 | 2021-07-14T05:05:31.000Z | 2022-03-31T14:11:59.000Z | towhee/dag/graph_builder.py | jennyli-z/towhee | 55c55fd961229575b75eae269b55090c839f8dcd | [
"Apache-2.0"
] | 199 | 2021-07-13T08:40:43.000Z | 2022-03-31T19:10:23.000Z | # Copyright 2021 Zilliz. 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 agree... | 32.52459 | 85 | 0.689012 |
from graph_repr import GraphRepr
from operator_repr import OperatorRepr
from operator import Operator
from variable_repr import VariableReprSet
class GraphBuilder:
START_OP = '_start'
END_OP = '_end'
def __init__(self, builder_id: str = None, pipeline_func=None):
self.builder_id =... | true | true |
f75033654225f7e78577629332a09c83694c5959 | 1,239 | py | Python | tests/test_update.py | Rohitth007/dfetch | 947ba95e79451c8c7dc82eeb4e5b4b117addf7bd | [
"MIT"
] | null | null | null | tests/test_update.py | Rohitth007/dfetch | 947ba95e79451c8c7dc82eeb4e5b4b117addf7bd | [
"MIT"
] | null | null | null | tests/test_update.py | Rohitth007/dfetch | 947ba95e79451c8c7dc82eeb4e5b4b117addf7bd | [
"MIT"
] | null | null | null | """Test the check command."""
# mypy: ignore-errors
# flake8: noqa
import argparse
from typing import Tuple
from unittest.mock import MagicMock, Mock, patch
import pytest
import dfetch
from dfetch.commands.update import Update
from dfetch.manifest.manifest import Manifest
from dfetch.manifest.project import ProjectE... | 24.78 | 83 | 0.673931 |
import argparse
from typing import Tuple
from unittest.mock import MagicMock, Mock, patch
import pytest
import dfetch
from dfetch.commands.update import Update
from dfetch.manifest.manifest import Manifest
from dfetch.manifest.project import ProjectEntry
def mock_manifest(name, projects):
project_mocks = []... | true | true |
f750341495ca196d67e5fa87cb8f6283bdf8c9fa | 466 | py | Python | Task 1.py | sofity/Starikova-xmljson | 5a31a74245a094692e386b316a50c19ae5c869b8 | [
"MIT"
] | null | null | null | Task 1.py | sofity/Starikova-xmljson | 5a31a74245a094692e386b316a50c19ae5c869b8 | [
"MIT"
] | null | null | null | Task 1.py | sofity/Starikova-xmljson | 5a31a74245a094692e386b316a50c19ae5c869b8 | [
"MIT"
] | null | null | null | import xml.etree.ElementTree as ET
import json
from urllib.request import urlopen
data = urlopen('https://lenta.ru/rss').read().decode('utf8')
root = ET.fromstring(data)
date_header = []
for news in root.iter('item'):
title = news.find('title').text
pubDate = news.find('pubDate').text
date_header.append(... | 27.411765 | 60 | 0.699571 | import xml.etree.ElementTree as ET
import json
from urllib.request import urlopen
data = urlopen('https://lenta.ru/rss').read().decode('utf8')
root = ET.fromstring(data)
date_header = []
for news in root.iter('item'):
title = news.find('title').text
pubDate = news.find('pubDate').text
date_header.append(... | true | true |
f750344b92bb42f41c10e53b41c4143879ed84d8 | 1,616 | gyp | Python | binding.gyp | ykhilaji/node-printer-32 | b1201e4bd8a7f82fd3775ed440692ca5a1070219 | [
"MIT"
] | 2 | 2020-06-04T20:45:39.000Z | 2021-07-29T23:15:53.000Z | binding.gyp | ykhilaji/node-printer-32 | b1201e4bd8a7f82fd3775ed440692ca5a1070219 | [
"MIT"
] | null | null | null | binding.gyp | ykhilaji/node-printer-32 | b1201e4bd8a7f82fd3775ed440692ca5a1070219 | [
"MIT"
] | 1 | 2017-08-17T09:58:30.000Z | 2017-08-17T09:58:30.000Z | {
'variables': {
'module_name%': 'node_printer',
'module_path%': './lib/'
},
'targets': [
{
"target_name": "action_after_build",
"type": "none",
"dependencies": [ "<(module_name)" ],
"copies": [
{
"files": [ "<(PRODUCT_DIR)/<(module_name).node" ],
"d... | 28.350877 | 93 | 0.428837 | {
'variables': {
'module_name%': 'node_printer',
'module_path%': './lib/'
},
'targets': [
{
"target_name": "action_after_build",
"type": "none",
"dependencies": [ "<(module_name)" ],
"copies": [
{
"files": [ "<(PRODUCT_DIR)/<(module_name).node" ],
"d... | true | true |
f75035847e09dbec6fee86087ca60d60939fce7c | 3,850 | py | Python | tests/gold_tests/pluginTest/cookie_remap/bucketcookie.test.py | cmcfarlen/trafficserver | 2aa1d3106398eb082e5a454212b0273c63d5f69d | [
"Apache-2.0"
] | 1,351 | 2015-01-03T08:25:40.000Z | 2022-03-31T09:14:08.000Z | tests/gold_tests/pluginTest/cookie_remap/bucketcookie.test.py | cmcfarlen/trafficserver | 2aa1d3106398eb082e5a454212b0273c63d5f69d | [
"Apache-2.0"
] | 7,009 | 2015-01-14T16:22:45.000Z | 2022-03-31T17:18:04.000Z | tests/gold_tests/pluginTest/cookie_remap/bucketcookie.test.py | cmcfarlen/trafficserver | 2aa1d3106398eb082e5a454212b0273c63d5f69d | [
"Apache-2.0"
] | 901 | 2015-01-11T19:21:08.000Z | 2022-03-18T18:21:33.000Z | '''
'''
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License");... | 37.378641 | 121 | 0.732987 |
import os
Test.Summary = '''
'''
Test.SkipUnless(Condition.PluginExists('cookie_remap.so'))
Test.ContinueOnFail = True
Test.testName = "cookie_remap: cookie in bucket or not"
ts = Test.MakeATSProcess("ts")
server = Test.MakeOriginServer("server", ip='127.0.0.10')
request_header = {"headers": "GET... | true | true |
f75035a8e11eaed2b0ecce12c2ca6bb312368c9b | 4,332 | py | Python | parser/fase2/team29/analizer_pl/C3D/operations/datatype.py | JohnnyBro/tytus | 8422316c52530fce975d630d3271ccd6ea965560 | [
"MIT"
] | null | null | null | parser/fase2/team29/analizer_pl/C3D/operations/datatype.py | JohnnyBro/tytus | 8422316c52530fce975d630d3271ccd6ea965560 | [
"MIT"
] | null | null | null | parser/fase2/team29/analizer_pl/C3D/operations/datatype.py | JohnnyBro/tytus | 8422316c52530fce975d630d3271ccd6ea965560 | [
"MIT"
] | null | null | null | from analizer_pl.abstract.expression import Expression
from analizer_pl.modules.expressions import C3D
from analizer_pl.C3D.operations import operation
from analizer_pl.reports.Nodo import Nodo
from analizer_pl.abstract.global_env import GlobalEnvironment
class Identifier(Expression):
def __init__(self, id, isBloc... | 31.391304 | 96 | 0.581025 | from analizer_pl.abstract.expression import Expression
from analizer_pl.modules.expressions import C3D
from analizer_pl.C3D.operations import operation
from analizer_pl.reports.Nodo import Nodo
from analizer_pl.abstract.global_env import GlobalEnvironment
class Identifier(Expression):
def __init__(self, id, isBloc... | true | true |
f750371323ac2066d544aa1d88992b1e0ccd22b9 | 5,306 | py | Python | src/sst/elements/memHierarchy/tests/testBackendTimingDRAM-3.py | jleidel/sst-elements | ad60d81078a9a1dca0ffc04411858491953c6a73 | [
"BSD-3-Clause"
] | null | null | null | src/sst/elements/memHierarchy/tests/testBackendTimingDRAM-3.py | jleidel/sst-elements | ad60d81078a9a1dca0ffc04411858491953c6a73 | [
"BSD-3-Clause"
] | null | null | null | src/sst/elements/memHierarchy/tests/testBackendTimingDRAM-3.py | jleidel/sst-elements | ad60d81078a9a1dca0ffc04411858491953c6a73 | [
"BSD-3-Clause"
] | null | null | null | # Automatically generated SST Python input
import sst
from mhlib import componentlist
# Test timingDRAM with transactionQ = reorderTransactionQ and AddrMapper=sandyBridgeAddrMapper and pagepolicy=timeoutPagePolicy
# Define the simulation components
cpu_params = {
"clock" : "3GHz",
"do_write" : 1,
"num_loa... | 32.157576 | 127 | 0.631738 |
import sst
from mhlib import componentlist
cpu_params = {
"clock" : "3GHz",
"do_write" : 1,
"num_loadstore" : "5000",
"memSize" : "0x100000"
}
bus = sst.Component("bus", "memHierarchy.Bus")
bus.addParams({ "bus_frequency" : "2Ghz" })
l3cache = sst.Component("l3cache", "memHierarchy.Cache... | true | true |
f75038109a686abc929b9f519cda94785b178ceb | 17,404 | py | Python | nautobot/circuits/tests/test_filters.py | psmware-ltd/nautobot | ac516287fb8edcc3482bd011839de837c6bbf0df | [
"Apache-2.0"
] | 384 | 2021-02-24T01:40:40.000Z | 2022-03-30T10:30:59.000Z | nautobot/circuits/tests/test_filters.py | psmware-ltd/nautobot | ac516287fb8edcc3482bd011839de837c6bbf0df | [
"Apache-2.0"
] | 1,067 | 2021-02-24T00:58:08.000Z | 2022-03-31T23:38:23.000Z | nautobot/circuits/tests/test_filters.py | psmware-ltd/nautobot | ac516287fb8edcc3482bd011839de837c6bbf0df | [
"Apache-2.0"
] | 128 | 2021-02-24T02:45:16.000Z | 2022-03-20T18:48:36.000Z | from django.test import TestCase
from nautobot.circuits.filters import (
CircuitFilterSet,
CircuitTerminationFilterSet,
CircuitTypeFilterSet,
ProviderFilterSet,
)
from nautobot.circuits.models import Circuit, CircuitTermination, CircuitType, Provider
from nautobot.dcim.models import Cable, Device, Devi... | 40.568765 | 116 | 0.593025 | from django.test import TestCase
from nautobot.circuits.filters import (
CircuitFilterSet,
CircuitTerminationFilterSet,
CircuitTypeFilterSet,
ProviderFilterSet,
)
from nautobot.circuits.models import Circuit, CircuitTermination, CircuitType, Provider
from nautobot.dcim.models import Cable, Device, Devi... | true | true |
f75038853542f7d74e3d70c10c62ad68b9f0b39b | 22,971 | py | Python | blaze/expr/collections.py | thequackdaddy/blaze | 21ba90c17b6b807623bbc9996bfc838f13ee6ea1 | [
"BSD-3-Clause"
] | null | null | null | blaze/expr/collections.py | thequackdaddy/blaze | 21ba90c17b6b807623bbc9996bfc838f13ee6ea1 | [
"BSD-3-Clause"
] | null | null | null | blaze/expr/collections.py | thequackdaddy/blaze | 21ba90c17b6b807623bbc9996bfc838f13ee6ea1 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division, print_function
import numbers
import numpy as np
from functools import partial
from itertools import chain
import datashape
from datashape import (DataShape, Option, Record, Unit, dshape, var, Fixed,
Var, promote, object_)
from datashape.predica... | 28.429455 | 104 | 0.553959 | from __future__ import absolute_import, division, print_function
import numbers
import numpy as np
from functools import partial
from itertools import chain
import datashape
from datashape import (DataShape, Option, Record, Unit, dshape, var, Fixed,
Var, promote, object_)
from datashape.predica... | true | true |
f75039b9ae96b9a954037d553ff74ae27cd78a36 | 2,055 | py | Python | beers/migrations/0023_auto_20190408_2248.py | danroberts728/hsvdotbeer | 5b977bf4a7aab149ad56564b3adbb09424500308 | [
"Apache-2.0"
] | 18 | 2018-12-06T01:46:37.000Z | 2021-10-17T10:37:17.000Z | beers/migrations/0023_auto_20190408_2248.py | danroberts728/hsvdotbeer | 5b977bf4a7aab149ad56564b3adbb09424500308 | [
"Apache-2.0"
] | 194 | 2018-11-04T12:50:49.000Z | 2022-01-06T22:43:43.000Z | beers/migrations/0023_auto_20190408_2248.py | danroberts728/hsvdotbeer | 5b977bf4a7aab149ad56564b3adbb09424500308 | [
"Apache-2.0"
] | 7 | 2019-03-18T05:36:06.000Z | 2020-12-25T03:27:29.000Z | # Generated by Django 2.2 on 2019-04-08 22:48
import django.contrib.postgres.fields.citext
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("beers", "0022_merge_common_endings"),
]
operations = [
migration... | 28.943662 | 83 | 0.400487 |
import django.contrib.postgres.fields.citext
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("beers", "0022_merge_common_endings"),
]
operations = [
migrations.CreateModel(
name="Style",
... | true | true |
f7503a154575ac2856890caea193ff042f3a2b36 | 3,835 | py | Python | sdk/python/kfp/deprecated/_runners.py | RonsenbergVI/pipelines | a85dc4f5f1f65f14bd807dec9ab25d8dafb34379 | [
"Apache-2.0"
] | 2,860 | 2018-05-24T04:55:01.000Z | 2022-03-31T13:49:56.000Z | sdk/python/kfp/deprecated/_runners.py | RonsenbergVI/pipelines | a85dc4f5f1f65f14bd807dec9ab25d8dafb34379 | [
"Apache-2.0"
] | 7,331 | 2018-05-16T09:03:26.000Z | 2022-03-31T23:22:04.000Z | sdk/python/kfp/deprecated/_runners.py | RonsenbergVI/pipelines | a85dc4f5f1f65f14bd807dec9ab25d8dafb34379 | [
"Apache-2.0"
] | 1,359 | 2018-05-15T11:05:41.000Z | 2022-03-31T09:42:09.000Z | # Copyright 2019 The Kubeflow Authors
#
# 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... | 39.947917 | 133 | 0.714733 |
__all__ = [
"run_pipeline_func_on_cluster",
"run_pipeline_func_locally",
]
from typing import Callable, List, Mapping, Optional
from . import Client, LocalClient, dsl
def run_pipeline_func_on_cluster(
pipeline_func: Callable,
arguments: Mapping[str, str],
run_name: str = None,
... | true | true |
f7503a8c34015169980afc3204ddc6c55ad2c0dc | 1,098 | py | Python | tests/test_voxel_encoders.py | BB88Lee/mmdetection3d | 62aeeadf70ac1229c595e3a4fe09d8a49df808f1 | [
"Apache-2.0"
] | 217 | 2021-12-10T09:44:33.000Z | 2022-03-31T16:17:35.000Z | tests/test_voxel_encoders.py | BB88Lee/mmdetection3d | 62aeeadf70ac1229c595e3a4fe09d8a49df808f1 | [
"Apache-2.0"
] | 38 | 2021-06-05T12:41:30.000Z | 2022-03-23T07:31:28.000Z | tests/test_voxel_encoders.py | BB88Lee/mmdetection3d | 62aeeadf70ac1229c595e3a4fe09d8a49df808f1 | [
"Apache-2.0"
] | 23 | 2021-12-13T06:56:38.000Z | 2022-03-28T02:02:13.000Z | import torch
from mmdet3d.models.builder import build_voxel_encoder
def test_pillar_feature_net():
pillar_feature_net_cfg = dict(
type='PillarFeatureNet',
in_channels=5,
feat_channels=[64],
with_distance=False,
voxel_size=(0.2, 0.2, 8),
point_cloud_range=(-51.2, -5... | 32.294118 | 68 | 0.684882 | import torch
from mmdet3d.models.builder import build_voxel_encoder
def test_pillar_feature_net():
pillar_feature_net_cfg = dict(
type='PillarFeatureNet',
in_channels=5,
feat_channels=[64],
with_distance=False,
voxel_size=(0.2, 0.2, 8),
point_cloud_range=(-51.2, -5... | true | true |
f7503aa1be46fdb679203a6d0e01ce2757684dd9 | 279 | py | Python | zsh/gitPush.py | Htet-Phyo-Lin/autoTask | 571c3a9697ac1394aa0cd42e272a2e718c9052cc | [
"MIT"
] | null | null | null | zsh/gitPush.py | Htet-Phyo-Lin/autoTask | 571c3a9697ac1394aa0cd42e272a2e718c9052cc | [
"MIT"
] | null | null | null | zsh/gitPush.py | Htet-Phyo-Lin/autoTask | 571c3a9697ac1394aa0cd42e272a2e718c9052cc | [
"MIT"
] | null | null | null | import os
ci = input("Commit name : ")
gitPush = [
"git",
"git status",
"git add .",
"git commit -m \"{}\"".format(ci),
"git push",
]
for x in gitPush:
os.system(x)
#Written by Htet Phyo Lin.
#If you have any errors. plz contact me " htetphyolin18@ucsmgy.edu.mm " .
| 13.285714 | 73 | 0.612903 | import os
ci = input("Commit name : ")
gitPush = [
"git",
"git status",
"git add .",
"git commit -m \"{}\"".format(ci),
"git push",
]
for x in gitPush:
os.system(x)
| true | true |
f7503aede30d3c5ba8690700eab8ff3434c06173 | 4,053 | py | Python | src/repos/outages/getLongTimeUnrevForcedOtgs.py | nagasudhirpulla/mis_outages_ingest | 3f2326a903b1e9bc5ba2c52c18905c985ca52b34 | [
"MIT"
] | null | null | null | src/repos/outages/getLongTimeUnrevForcedOtgs.py | nagasudhirpulla/mis_outages_ingest | 3f2326a903b1e9bc5ba2c52c18905c985ca52b34 | [
"MIT"
] | 5 | 2020-09-19T08:52:48.000Z | 2021-06-02T03:29:38.000Z | src/repos/outages/getLongTimeUnrevForcedOtgs.py | nagasudhirpulla/mis_outages_ingest | 3f2326a903b1e9bc5ba2c52c18905c985ca52b34 | [
"MIT"
] | 2 | 2020-09-19T08:45:47.000Z | 2020-11-07T12:00:24.000Z | import datetime as dt
import cx_Oracle
from typing import List
from src.typeDefs.outage import IOutage
from src.utils.stringUtils import removeRedundantRemarks, combineTagReasonRemarks
def getLongTimeUnrevivedForcedOutages(conStr: str, startDt: dt.datetime, endDt: dt.datetime) -> List[IOutage]:
"""fetch forced ou... | 40.53 | 124 | 0.660498 | import datetime as dt
import cx_Oracle
from typing import List
from src.typeDefs.outage import IOutage
from src.utils.stringUtils import removeRedundantRemarks, combineTagReasonRemarks
def getLongTimeUnrevivedForcedOutages(conStr: str, startDt: dt.datetime, endDt: dt.datetime) -> List[IOutage]:
con = cx_Orac... | true | true |
f7503af0ac3436d9cc5f1ca47b51d6374385d13b | 2,999 | py | Python | basis_set_exchange/writers/dalton.py | ltalirz/basis_set_exchange | 0e9601d7b37ae7672a78a335e34ac5591dd509f0 | [
"BSD-3-Clause"
] | 108 | 2018-07-09T14:23:49.000Z | 2022-03-30T08:26:15.000Z | basis_set_exchange/writers/dalton.py | susilehtola/basis_set_exchange | 0185cecc56a67ad561167290fd56ac86c0c76ce7 | [
"BSD-3-Clause"
] | 230 | 2018-06-01T15:15:49.000Z | 2022-03-30T12:02:11.000Z | basis_set_exchange/writers/dalton.py | susilehtola/basis_set_exchange | 0185cecc56a67ad561167290fd56ac86c0c76ce7 | [
"BSD-3-Clause"
] | 38 | 2018-07-20T15:16:47.000Z | 2022-03-30T08:32:45.000Z | '''
Conversion of basis sets to Dalton format
'''
from .. import lut, manip, sort, misc, printing
def write_dalton(basis):
'''Converts a basis set to Dalton format
'''
s = '! Basis = {}\n\n'.format(basis['name'])
basis = manip.make_general(basis, False, True)
basis = sort.sort_basis(basis, Fals... | 35.702381 | 116 | 0.537846 |
from .. import lut, manip, sort, misc, printing
def write_dalton(basis):
s = '! Basis = {}\n\n'.format(basis['name'])
basis = manip.make_general(basis, False, True)
basis = sort.sort_basis(basis, False)
electron_elements = [k for k, v in basis['elements'].items() if 'electron_shells' in v]
... | true | true |
f7503b9af9850897854d2f8c0bf23d1ca238edc0 | 6,743 | py | Python | utils/models/unetplusplus/model.py | bhklab/ptl-oar-segmentation | 354c3ee7f042a025f74e210a7b8462beac9b727d | [
"Apache-2.0"
] | 3 | 2022-01-18T19:25:46.000Z | 2022-02-05T18:53:24.000Z | utils/models/unetplusplus/model.py | bhklab/ptl-oar-segmentation | 354c3ee7f042a025f74e210a7b8462beac9b727d | [
"Apache-2.0"
] | null | null | null | utils/models/unetplusplus/model.py | bhklab/ptl-oar-segmentation | 354c3ee7f042a025f74e210a7b8462beac9b727d | [
"Apache-2.0"
] | null | null | null | import torch
from torch import nn
from .parts import *
__all__ = ["VGGUNet", "NestedUNet"]
class VGGUNet(nn.Module):
def __init__(self, num_classes, input_channels=3, leak_p=0.1, factor=1, **kwargs):
super().__init__()
nb_filter = [
32 // factor,
64 // factor,
... | 39.899408 | 89 | 0.599881 | import torch
from torch import nn
from .parts import *
__all__ = ["VGGUNet", "NestedUNet"]
class VGGUNet(nn.Module):
def __init__(self, num_classes, input_channels=3, leak_p=0.1, factor=1, **kwargs):
super().__init__()
nb_filter = [
32 // factor,
64 // factor,
... | true | true |
f7503d753a9645e598231dc27de11b0d912d2a01 | 6,686 | py | Python | cifar/trans_trans.py | WendyBaiYunwei/FSL | e20470872d52332efdb1449b4593445c5d94e4fb | [
"MIT"
] | null | null | null | cifar/trans_trans.py | WendyBaiYunwei/FSL | e20470872d52332efdb1449b4593445c5d94e4fb | [
"MIT"
] | null | null | null | cifar/trans_trans.py | WendyBaiYunwei/FSL | e20470872d52332efdb1449b4593445c5d94e4fb | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.optim.lr_scheduler import StepLR
from torchvision import datasets
import torchvision.transforms as transforms
from self_attention_cv import TransformerEncoder
import argparse
import math
import numpy as np
from torchvision import datasets... | 31.242991 | 99 | 0.584505 | import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.optim.lr_scheduler import StepLR
from torchvision import datasets
import torchvision.transforms as transforms
from self_attention_cv import TransformerEncoder
import argparse
import math
import numpy as np
from torchvision import datasets... | true | true |
f7503ebf7aaa5c7ce02e44b0c4d69bcd2642a0a3 | 1,386 | py | Python | mushroom_rl/algorithms/value/td/q_lambda.py | k4ntz/mushroom-rl | 17c8e9b2a9648a59169f3599c4ef8d259afc39f4 | [
"MIT"
] | null | null | null | mushroom_rl/algorithms/value/td/q_lambda.py | k4ntz/mushroom-rl | 17c8e9b2a9648a59169f3599c4ef8d259afc39f4 | [
"MIT"
] | null | null | null | mushroom_rl/algorithms/value/td/q_lambda.py | k4ntz/mushroom-rl | 17c8e9b2a9648a59169f3599c4ef8d259afc39f4 | [
"MIT"
] | null | null | null | import numpy as np
from mushroom_rl.algorithms.value.td import TD
from mushroom_rl.utils.eligibility_trace import EligibilityTrace
from mushroom_rl.utils.table import Table
class QLambda(TD):
"""
Q(Lambda) algorithm.
"Learning from Delayed Rewards". Watkins C.J.C.H.. 1989.
"""
def __init__(self,... | 27.72 | 72 | 0.622655 | import numpy as np
from mushroom_rl.algorithms.value.td import TD
from mushroom_rl.utils.eligibility_trace import EligibilityTrace
from mushroom_rl.utils.table import Table
class QLambda(TD):
def __init__(self, mdp_info, policy, learning_rate, lambda_coeff,
trace='replacing'):
Q = Table(... | true | true |
f7503f0bd8981392a0a05aebcf8cc7349e19de6e | 20,142 | py | Python | tensorflow_probability/python/experimental/mcmc/sample_sequential_monte_carlo.py | manda-creator/probability | 5238303f39973b7a365914732fe72f179a86cc97 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/experimental/mcmc/sample_sequential_monte_carlo.py | manda-creator/probability | 5238303f39973b7a365914732fe72f179a86cc97 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/experimental/mcmc/sample_sequential_monte_carlo.py | manda-creator/probability | 5238303f39973b7a365914732fe72f179a86cc97 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The TensorFlow Probability Authors.
#
# 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... | 39.649606 | 115 | 0.676249 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import tensorflow.compat.v2 as tf
from tensorflow_probability.python.internal import prefer_static as ps
from tensorflow_probability.python.math.generic import reduce_logmean... | true | true |
f7504037da7f92d5f4b3d3519b2d36af58f59b5b | 5,591 | py | Python | 15-computer-vision/Python/image-analysis/image-analysis.py | raj713335/AI-102 | 15f4b61dbcbf84abf25ce2f967afc0d52795e9f8 | [
"MIT"
] | null | null | null | 15-computer-vision/Python/image-analysis/image-analysis.py | raj713335/AI-102 | 15f4b61dbcbf84abf25ce2f967afc0d52795e9f8 | [
"MIT"
] | null | null | null | 15-computer-vision/Python/image-analysis/image-analysis.py | raj713335/AI-102 | 15f4b61dbcbf84abf25ce2f967afc0d52795e9f8 | [
"MIT"
] | null | null | null | from dotenv import load_dotenv
import os
from array import array
from PIL import Image, ImageDraw
import sys
import time
from matplotlib import pyplot as plt
import numpy as np
# import namespaces
from azure.cognitiveservices.vision.computervision import ComputerVisionClient
from azure.cognitiveservices.vision.comput... | 34.512346 | 121 | 0.608478 | from dotenv import load_dotenv
import os
from array import array
from PIL import Image, ImageDraw
import sys
import time
from matplotlib import pyplot as plt
import numpy as np
from azure.cognitiveservices.vision.computervision import ComputerVisionClient
from azure.cognitiveservices.vision.computervision.models imp... | true | true |
f7504115c0de7d5c00a8d5e6436df88e7fd2795e | 297 | py | Python | manage.py | bitlabstudio/django-mailer-throttled | 182c567c5fe2d046c09655fd874ef19374e3aacf | [
"MIT"
] | 1 | 2018-01-22T10:51:56.000Z | 2018-01-22T10:51:56.000Z | manage.py | bitlabstudio/django-mailer-throttled | 182c567c5fe2d046c09655fd874ef19374e3aacf | [
"MIT"
] | null | null | null | manage.py | bitlabstudio/django-mailer-throttled | 182c567c5fe2d046c09655fd874ef19374e3aacf | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
'mailer_throttled.tests.south_settings')
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 24.75 | 66 | 0.717172 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
'mailer_throttled.tests.south_settings')
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| true | true |
f7504152a1392f14bba36ecb22526480c0f1fda8 | 974 | py | Python | book-recommender/reviews/urls.py | abhaymandhan/read-this-book | a98222d011dab5469bdfaa034a2b0f35b66b3a3f | [
"Apache-2.0"
] | 1 | 2021-07-02T01:56:52.000Z | 2021-07-02T01:56:52.000Z | book-recommender/reviews/urls.py | abhaymandhan/read-this-book | a98222d011dab5469bdfaa034a2b0f35b66b3a3f | [
"Apache-2.0"
] | null | null | null | book-recommender/reviews/urls.py | abhaymandhan/read-this-book | a98222d011dab5469bdfaa034a2b0f35b66b3a3f | [
"Apache-2.0"
] | 2 | 2019-01-20T17:09:31.000Z | 2019-01-22T09:15:45.000Z | from django.conf.urls import url
from . import views
urlpatterns = [
# ex: /
url(r'^$', views.review_list, name='review_list'),
# ex: /review/5/
url(r'^review/(?P<review_id>[0-9]+)/$', views.review_detail, name='review_detail'),
# ex: /book/
url(r'^book$', views.book_list, name='book_list'),
... | 46.380952 | 95 | 0.660164 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.review_list, name='review_list'),
url(r'^review/(?P<review_id>[0-9]+)/$', views.review_detail, name='review_detail'),
url(r'^book$', views.book_list, name='book_list'),
url(r'^book/(?P<book_id>[0-... | true | true |
f750422c36254b84145b6abdafaddcec279ceb70 | 5,504 | py | Python | qcelemental/datum.py | coltonbh/QCElemental | b75fb72d7f45c8b605ae1a54773d4a8be6655752 | [
"BSD-3-Clause"
] | 99 | 2018-10-18T18:29:24.000Z | 2022-02-12T14:35:37.000Z | qcelemental/datum.py | coltonbh/QCElemental | b75fb72d7f45c8b605ae1a54773d4a8be6655752 | [
"BSD-3-Clause"
] | 254 | 2018-10-16T21:29:39.000Z | 2022-03-31T23:38:23.000Z | qcelemental/datum.py | coltonbh/QCElemental | b75fb72d7f45c8b605ae1a54773d4a8be6655752 | [
"BSD-3-Clause"
] | 67 | 2018-11-05T16:18:39.000Z | 2022-03-25T14:47:36.000Z | """
Datum Object Model
"""
from decimal import Decimal
from typing import Any, Dict, Optional
import numpy as np
from pydantic import BaseModel, validator
class Datum(BaseModel):
r"""Facilitates the storage of quantum chemical results by labeling them with basic metadata.
Attributes
----------
labe... | 32.761905 | 120 | 0.533975 |
from decimal import Decimal
from typing import Any, Dict, Optional
import numpy as np
from pydantic import BaseModel, validator
class Datum(BaseModel):
numeric: bool
label: str
units: str
data: Any
comment: str = ""
doi: Optional[str] = None
glossary: str = ""
class Config:
... | true | true |
f75044309008a6a3466c7d2fae6395fe2b067d7e | 6,520 | py | Python | clus/sel_season_area.py | jhardenberg/EnsClus | c7591aa39d649fc4321ac4db219f241aabcaf295 | [
"Apache-2.0"
] | null | null | null | clus/sel_season_area.py | jhardenberg/EnsClus | c7591aa39d649fc4321ac4db219f241aabcaf295 | [
"Apache-2.0"
] | null | null | null | clus/sel_season_area.py | jhardenberg/EnsClus | c7591aa39d649fc4321ac4db219f241aabcaf295 | [
"Apache-2.0"
] | 1 | 2019-02-13T18:00:34.000Z | 2019-02-13T18:00:34.000Z | # Standard packages
from netCDF4 import Dataset, num2date
from datetime import datetime
import numpy as np
import pandas as pd
#____________Selecting a season (DJF,DJFM,NDJFM,JJA)
def sel_season(var,dates,season,timestep):
#----------------------------------------------------------------------------------------
... | 37.045455 | 142 | 0.547853 |
from netCDF4 import Dataset, num2date
from datetime import datetime
import numpy as np
import pandas as pd
def sel_season(var,dates,season,timestep):
dates_pdh = pd.to_datetime(dates)
print(dates_pdh)
mesi_short = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct',... | true | true |
f750444be2c5fa241ad0f6e7d117941ecb1ddc64 | 3,048 | py | Python | Gradient Descent finding parameters.py | pengfei-ma/Google-Play-Store-Subjects-Analysis | 65d224eef9c0b6a2714f329edcfd5a4c32f6a2dd | [
"Apache-2.0"
] | null | null | null | Gradient Descent finding parameters.py | pengfei-ma/Google-Play-Store-Subjects-Analysis | 65d224eef9c0b6a2714f329edcfd5a4c32f6a2dd | [
"Apache-2.0"
] | null | null | null | Gradient Descent finding parameters.py | pengfei-ma/Google-Play-Store-Subjects-Analysis | 65d224eef9c0b6a2714f329edcfd5a4c32f6a2dd | [
"Apache-2.0"
] | null | null | null | import sys
from operator import add
from pyspark.sql import SparkSession
from pyspark import SparkContext
import pyspark
from pyspark.ml.linalg import Vectors
import numpy as np
from sklearn.linear_model import LinearRegression
from pyspark.sql.types import *
from pyspark.sql import functions as func
from pyspark.sql.f... | 27.214286 | 110 | 0.693241 | import sys
from operator import add
from pyspark.sql import SparkSession
from pyspark import SparkContext
import pyspark
from pyspark.ml.linalg import Vectors
import numpy as np
from sklearn.linear_model import LinearRegression
from pyspark.sql.types import *
from pyspark.sql import functions as func
from pyspark.sql.f... | true | true |
f750444ecf600364428cb0640221721178a4229f | 2,579 | py | Python | tests/unit/test_handler.py | ChristianHart/python-website-healthchecker | e67778beb7ff5c453b4987003fd538fe411d6f0f | [
"MIT"
] | 1 | 2021-01-15T22:32:43.000Z | 2021-01-15T22:32:43.000Z | tests/unit/test_handler.py | ChristianHart/python-website-healthchecker | e67778beb7ff5c453b4987003fd538fe411d6f0f | [
"MIT"
] | null | null | null | tests/unit/test_handler.py | ChristianHart/python-website-healthchecker | e67778beb7ff5c453b4987003fd538fe411d6f0f | [
"MIT"
] | 1 | 2021-03-02T01:36:36.000Z | 2021-03-02T01:36:36.000Z | import json
import pytest
from healthcheck import app
@pytest.fixture()
def apigw_event():
""" Generates API GW Event"""
return {
"body": '{ "test": "body"}',
"resource": "/{proxy+}",
"requestContext": {
"resourceId": "123456",
"apiId": "1234567890",
... | 34.851351 | 99 | 0.516867 | import json
import pytest
from healthcheck import app
@pytest.fixture()
def apigw_event():
return {
"body": '{ "test": "body"}',
"resource": "/{proxy+}",
"requestContext": {
"resourceId": "123456",
"apiId": "1234567890",
"resourcePath": "/{proxy+}",
... | true | true |
f750458f30ceccad6a567e33df2814dac9d34f52 | 588 | py | Python | AprendeAyudando/messaging/models.py | memoriasIT/AprendeAyudando | 0a32f59d3606075abb99a74ce1983a6171aa34cd | [
"CC0-1.0"
] | 1 | 2021-09-09T09:54:04.000Z | 2021-09-09T09:54:04.000Z | AprendeAyudando/messaging/models.py | memoriasIT/AprendeAyudando | 0a32f59d3606075abb99a74ce1983a6171aa34cd | [
"CC0-1.0"
] | null | null | null | AprendeAyudando/messaging/models.py | memoriasIT/AprendeAyudando | 0a32f59d3606075abb99a74ce1983a6171aa34cd | [
"CC0-1.0"
] | null | null | null | from django.db import models
from django.contrib.auth import get_user_model
class MessagingMessage(models.Model):
title = models.CharField(max_length=100)
text = models.TextField(max_length=2000, blank=True, null=True)
message_sent_date = models.DateTimeField(verbose_name="message sent date", auto_now_add... | 58.8 | 135 | 0.811224 | from django.db import models
from django.contrib.auth import get_user_model
class MessagingMessage(models.Model):
title = models.CharField(max_length=100)
text = models.TextField(max_length=2000, blank=True, null=True)
message_sent_date = models.DateTimeField(verbose_name="message sent date", auto_now_add... | true | true |
f75045983d6bd93a7335bbddd61c8fc54b87cb14 | 376 | py | Python | pyeccodes/defs/grib2/localConcepts/lfpw1/name_def.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | 7 | 2020-04-14T09:41:17.000Z | 2021-08-06T09:38:19.000Z | pyeccodes/defs/grib2/localConcepts/lfpw1/name_def.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | null | null | null | pyeccodes/defs/grib2/localConcepts/lfpw1/name_def.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | 3 | 2020-04-30T12:44:48.000Z | 2020-12-15T08:40:26.000Z | import pyeccodes.accessors as _
def load(h):
def wrapped(h):
discipline = h.get_l('discipline')
parameterCategory = h.get_l('parameterCategory')
parameterNumber = h.get_l('parameterNumber')
if discipline == 0 and parameterCategory == 1 and parameterNumber == 10:
retu... | 23.5 | 80 | 0.662234 | import pyeccodes.accessors as _
def load(h):
def wrapped(h):
discipline = h.get_l('discipline')
parameterCategory = h.get_l('parameterCategory')
parameterNumber = h.get_l('parameterNumber')
if discipline == 0 and parameterCategory == 1 and parameterNumber == 10:
retu... | true | true |
f75045b68265b6b9da691f29195b210c96a157a9 | 5,536 | py | Python | web/dog/dog/views.py | Ahmed-elshorbagy/dog_web_app | 058b79328d3ed16a77c312f39b5b150eb6423612 | [
"Unlicense"
] | null | null | null | web/dog/dog/views.py | Ahmed-elshorbagy/dog_web_app | 058b79328d3ed16a77c312f39b5b150eb6423612 | [
"Unlicense"
] | null | null | null | web/dog/dog/views.py | Ahmed-elshorbagy/dog_web_app | 058b79328d3ed16a77c312f39b5b150eb6423612 | [
"Unlicense"
] | null | null | null | # import the necessary packages
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from django.http import JsonResponse,HttpResponse
import numpy as np
import urllib
import json
import cv2
import os
from .face import dog_ear
from glob import glob
from .forms impo... | 36.421053 | 121 | 0.710441 |
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from django.http import JsonResponse,HttpResponse
import numpy as np
import urllib
import json
import cv2
import os
from .face import dog_ear
from glob import glob
from .forms import ImgForm,UrlForm
import base64
impor... | true | true |
f750470ed0d047811eca1714f6be8508938920e3 | 973 | py | Python | seed_scheduler/urls.py | praekelt/seed-scheduler | c4ca3e7ad27ad6fde1d5efbfcca047e7c2a3de55 | [
"BSD-3-Clause"
] | null | null | null | seed_scheduler/urls.py | praekelt/seed-scheduler | c4ca3e7ad27ad6fde1d5efbfcca047e7c2a3de55 | [
"BSD-3-Clause"
] | 18 | 2016-03-02T08:58:18.000Z | 2018-06-25T07:58:06.000Z | seed_scheduler/urls.py | praekeltfoundation/seed-scheduler | c4ca3e7ad27ad6fde1d5efbfcca047e7c2a3de55 | [
"BSD-3-Clause"
] | 1 | 2016-09-28T09:32:03.000Z | 2016-09-28T09:32:03.000Z | import os
from django.conf.urls import include, url
from django.contrib import admin
from django.urls import path
from django_prometheus import exports as django_prometheus
from rest_framework.authtoken.views import obtain_auth_token
from rest_framework.documentation import include_docs_urls
from scheduler import vie... | 34.75 | 86 | 0.754368 | import os
from django.conf.urls import include, url
from django.contrib import admin
from django.urls import path
from django_prometheus import exports as django_prometheus
from rest_framework.authtoken.views import obtain_auth_token
from rest_framework.documentation import include_docs_urls
from scheduler import vie... | true | true |
f75048172c9c43354d30cee11b5eb013fc10cc92 | 3,242 | py | Python | OnlyWavenet.py | itouchz/TRepNet | 5fa9f273dc57b778ac0a94fffcb926de333ecc37 | [
"Apache-2.0"
] | null | null | null | OnlyWavenet.py | itouchz/TRepNet | 5fa9f273dc57b778ac0a94fffcb926de333ecc37 | [
"Apache-2.0"
] | null | null | null | OnlyWavenet.py | itouchz/TRepNet | 5fa9f273dc57b778ac0a94fffcb926de333ecc37 | [
"Apache-2.0"
] | 1 | 2021-07-16T09:46:58.000Z | 2021-07-16T09:46:58.000Z | import numpy as np
import pandas as pd
import tensorflow as tf
import os
import warnings
import time
warnings.filterwarnings('ignore')
from tensorflow import keras
from sklearn.preprocessing import RobustScaler, Normalizer, StandardScaler
from sklearn.model_selection import train_test_split
from datasets import load... | 39.060241 | 135 | 0.720851 | import numpy as np
import pandas as pd
import tensorflow as tf
import os
import warnings
import time
warnings.filterwarnings('ignore')
from tensorflow import keras
from sklearn.preprocessing import RobustScaler, Normalizer, StandardScaler
from sklearn.model_selection import train_test_split
from datasets import load... | true | true |
f750489f4f9c3777675ff8db4c72d550e474919e | 187,464 | py | Python | scripts/cpp_lint.py | asadanwar100/caffe | b6f128f580372868cdca0412c9755da24eedd6b6 | [
"BSD-2-Clause"
] | 1,371 | 2016-11-16T20:20:22.000Z | 2022-03-13T04:04:33.000Z | scripts/cpp_lint.py | asadanwar100/caffe | b6f128f580372868cdca0412c9755da24eedd6b6 | [
"BSD-2-Clause"
] | 201 | 2015-08-15T14:32:42.000Z | 2022-02-01T21:17:13.000Z | scripts/cpp_lint.py | asadanwar100/caffe | b6f128f580372868cdca0412c9755da24eedd6b6 | [
"BSD-2-Clause"
] | 622 | 2016-11-17T03:15:22.000Z | 2022-03-23T05:19:25.000Z | #!/usr/bin/python2
#
# Copyright (c) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... | 38.50154 | 93 | 0.652893 |
import codecs
import copy
import getopt
import math
import os
import re
import sre_compile
import string
import sys
import unicodedata
_USAGE = """
Syntax: cpp_lint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...]
[--counting=total|toplevel|detailed] [--root=sub... | true | true |
f75049cf38adb595dcb825883d0b33d1fa8d0081 | 18,227 | py | Python | GUI/PyQt/cPatches.py | so2liu/CNNArt | 9d91bf08a044e7d5068f8446663726411d2236dd | [
"Apache-2.0"
] | null | null | null | GUI/PyQt/cPatches.py | so2liu/CNNArt | 9d91bf08a044e7d5068f8446663726411d2236dd | [
"Apache-2.0"
] | null | null | null | GUI/PyQt/cPatches.py | so2liu/CNNArt | 9d91bf08a044e7d5068f8446663726411d2236dd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'cPatches.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Patches(object):
def setupUi(self, Patches):
Patches.setObjec... | 50.630556 | 108 | 0.656718 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Patches(object):
def setupUi(self, Patches):
Patches.setObjectName("Patches")
Patches.resize(497, 492)
self.verticalLayout = QtWidgets.QVBoxLayout(Patches)
self.verticalLayout.setObjectName("verticalLayout")
self.gr... | true | true |
f75049dc9b46a4f31e6f531ff9a012abe299aada | 2,358 | py | Python | guillotina/tests/test_queue.py | diefenbach/guillotina | a8c7247fca8294752901f643b35c5ed1c5dee76d | [
"BSD-2-Clause"
] | null | null | null | guillotina/tests/test_queue.py | diefenbach/guillotina | a8c7247fca8294752901f643b35c5ed1c5dee76d | [
"BSD-2-Clause"
] | null | null | null | guillotina/tests/test_queue.py | diefenbach/guillotina | a8c7247fca8294752901f643b35c5ed1c5dee76d | [
"BSD-2-Clause"
] | null | null | null | from guillotina.async_util import IAsyncJobPool
from guillotina.async_util import IQueueUtility
from guillotina.browser import View
from guillotina.component import get_utility
from guillotina.tests import utils
import asyncio
class AsyncMockView(View):
def __init__(self, context, request, func, *args, **kwargs... | 26.494382 | 77 | 0.670059 | from guillotina.async_util import IAsyncJobPool
from guillotina.async_util import IQueueUtility
from guillotina.browser import View
from guillotina.component import get_utility
from guillotina.tests import utils
import asyncio
class AsyncMockView(View):
def __init__(self, context, request, func, *args, **kwargs... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.