hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
df28874a6a9e12be177a5e947381918a7530d3a5 | 22,212 | py | Python | dev/generate-tests.py | lgray/awkward-1.0 | 518232b1c6758e3d9bf94fae91a72696d2d3e6ce | [
"BSD-3-Clause"
] | 1 | 2021-04-01T09:31:27.000Z | 2021-04-01T09:31:27.000Z | dev/generate-tests.py | lgray/awkward-1.0 | 518232b1c6758e3d9bf94fae91a72696d2d3e6ce | [
"BSD-3-Clause"
] | null | null | null | dev/generate-tests.py | lgray/awkward-1.0 | 518232b1c6758e3d9bf94fae91a72696d2d3e6ce | [
"BSD-3-Clause"
] | null | null | null | # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
import copy
import os
from collections import OrderedDict
from itertools import product
import yaml
from numpy import uint8
CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))
class Argument(object):
def __init__(self... | 39.382979 | 145 | 0.4028 |
9f7dd1c91093de2ed8c98c35542f8873300e9e08 | 1,555 | py | Python | yatube/posts/views.py | dmis0k/yatube_project | f12d3464806e4ae8521a30b22388ba7ee9df77ff | [
"BSD-3-Clause"
] | null | null | null | yatube/posts/views.py | dmis0k/yatube_project | f12d3464806e4ae8521a30b22388ba7ee9df77ff | [
"BSD-3-Clause"
] | null | null | null | yatube/posts/views.py | dmis0k/yatube_project | f12d3464806e4ae8521a30b22388ba7ee9df77ff | [
"BSD-3-Clause"
] | null | null | null | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse
from django.template import loader
from .models import Post, Group
def index(request):
# Одна строка вместо тысячи слов на SQL:
# в переменную posts будет сохранена выборка из 10 объектов модели Post,
# отсо... | 33.085106 | 86 | 0.659164 |
dabb042f5ebe429c749208d6e45f20f478d60090 | 149 | py | Python | .history/ClassFiles/Operators/BinaryNumbers_20201230175647.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/Operators/BinaryNumbers_20201230175647.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/Operators/BinaryNumbers_20201230175647.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | """ WHAT IS BINARY?
Binary is the language that computers understand.
Binary consists of 0's and 1's.
Binary is a system of counting.
""" | 16.555556 | 49 | 0.684564 |
23be0f05a5cc0e4c936ed50fcc357f3b5c8d7135 | 26,209 | py | Python | test/integ/test_put_get_medium.py | groodt/snowflake-connector-python | 26d0a36cb9a65a728e745f077bd11ab536d386f8 | [
"Apache-2.0"
] | 3 | 2021-03-05T22:01:00.000Z | 2021-04-02T17:48:33.000Z | test/integ/test_put_get_medium.py | groodt/snowflake-connector-python | 26d0a36cb9a65a728e745f077bd11ab536d386f8 | [
"Apache-2.0"
] | 23 | 2020-12-08T06:59:00.000Z | 2022-02-15T14:06:43.000Z | test/integ/test_put_get_medium.py | groodt/snowflake-connector-python | 26d0a36cb9a65a728e745f077bd11ab536d386f8 | [
"Apache-2.0"
] | 1 | 2021-03-05T22:08:46.000Z | 2021-03-05T22:08:46.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2020 Snowflake Computing Inc. All right reserved.
#
import datetime
import gzip
import os
import sys
import time
from logging import getLogger
import pytest
import pytz
from snowflake.connector import ProgrammingError
from snowflake.connector.curso... | 34.530962 | 126 | 0.564272 |
58688d53b16bdebb895d0356119c5a145fa5f9a9 | 3,838 | py | Python | tutorials/03.gpt2_chatbot/interact.py | viola-yuan/nlp-journey | 54c3d86674f66462113dbbe828353cd3b7fc683b | [
"Apache-2.0"
] | 1 | 2020-10-20T05:53:10.000Z | 2020-10-20T05:53:10.000Z | tutorials/03.gpt2_chatbot/interact.py | viola-yuan/nlp-journey | 54c3d86674f66462113dbbe828353cd3b7fc683b | [
"Apache-2.0"
] | null | null | null | tutorials/03.gpt2_chatbot/interact.py | viola-yuan/nlp-journey | 54c3d86674f66462113dbbe828353cd3b7fc683b | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# created by msg on 2020/7/1
import os
from datetime import datetime
import config
import torch
import torch.nn.functional as F
from util import logger
from model import create_model
def top_k_top_p_filtering(logits, top_k=0, top_p=0.0, filter_value=-float('Inf')):
assert logits.dim() == 1
to... | 38.767677 | 114 | 0.64148 |
bd7e5ff73fb52755d11eb37edfbced0f553c6d33 | 1,178 | py | Python | response/core/urls.py | ojno/response | 0f8d2a8378a02c1f4680a04e4a943d7e32234a22 | [
"MIT"
] | 1,408 | 2019-05-03T11:39:34.000Z | 2022-03-31T17:51:04.000Z | response/core/urls.py | ojno/response | 0f8d2a8378a02c1f4680a04e4a943d7e32234a22 | [
"MIT"
] | 105 | 2019-05-04T07:59:44.000Z | 2022-03-14T04:47:02.000Z | response/core/urls.py | ojno/response | 0f8d2a8378a02c1f4680a04e4a943d7e32234a22 | [
"MIT"
] | 177 | 2019-05-03T18:11:46.000Z | 2022-03-25T04:49:57.000Z | from django.conf.urls import include, url
from rest_framework import routers
from response.core.views import (
ActionViewSet,
EventsViewSet,
ExternalUserViewSet,
IncidentActionViewSet,
IncidentsByMonthViewSet,
IncidentTimelineEventViewSet,
IncidentViewSet,
)
# Routers provide an easy way o... | 30.205128 | 72 | 0.747029 |
c848b528fbef965c49d3453451b05768b4055347 | 19,227 | py | Python | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/ospfv2/global_/graceful_restart/state/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 64 | 2016-10-20T15:47:18.000Z | 2021-11-11T11:57:32.000Z | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/ospfv2/global_/graceful_restart/state/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 126 | 2016-10-05T10:36:14.000Z | 2019-05-15T08:43:23.000Z | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/ospfv2/global_/graceful_restart/state/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 63 | 2016-11-07T15:23:08.000Z | 2021-09-22T14:41:16.000Z | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | 39.480493 | 347 | 0.617465 |
db9a54f2237ffa24da588edce7b1bc6d92e7d761 | 2,863 | py | Python | bdaybot/cogs/meme.py | Ahsoka/bdaybot | 3aec9509119c28b294efdc0c76e8ee7fda7e8553 | [
"MIT"
] | 5 | 2021-01-21T07:49:50.000Z | 2022-02-09T17:13:09.000Z | bdaybot/cogs/meme.py | Ahsoka/bdaybot | 3aec9509119c28b294efdc0c76e8ee7fda7e8553 | [
"MIT"
] | 22 | 2020-12-30T02:13:32.000Z | 2022-02-24T05:52:54.000Z | bdaybot/cogs/meme.py | Ahsoka/bdaybot | 3aec9509119c28b294efdc0c76e8ee7fda7e8553 | [
"MIT"
] | 3 | 2021-02-02T05:21:14.000Z | 2021-08-20T01:16:30.000Z | import logging
import asyncio
from discord.ext import commands
from ..utils import format_iterable, devs
logger = logging.getLogger(__name__)
class EasterEggsCog(commands.Cog):
@commands.Cog.listener()
async def on_message(self, message):
valid_purposes = ['your purpose', 'ur purpose']
secret... | 48.525424 | 123 | 0.599721 |
19d3eb53ab511d3287056cd91b420257e3bdf61a | 1,803 | py | Python | src/Graph.py | robinzixuan/Minimum-Vertex-Cover | 2ce5a381ae85fba0ae93274df1989c95bcf7f53a | [
"MIT"
] | null | null | null | src/Graph.py | robinzixuan/Minimum-Vertex-Cover | 2ce5a381ae85fba0ae93274df1989c95bcf7f53a | [
"MIT"
] | null | null | null | src/Graph.py | robinzixuan/Minimum-Vertex-Cover | 2ce5a381ae85fba0ae93274df1989c95bcf7f53a | [
"MIT"
] | null | null | null | class Vertex:
def __init__(self, vertex):
self.id = vertex
self.adjacent = {}
def __str__(self):
return str([x.id for x in self.adjacent])
def add_neighbor(self, neighbor, weight=0):
if neighbor in self.adjacent:
self.adjacent[neighbor].append(weight)
el... | 25.041667 | 56 | 0.572934 |
ded1880ca47866f590e7a84e20d883f2aa84f748 | 5,750 | py | Python | src/simmer/add_dark_exp.py | holdengill/SImMER | 7608a9cb044f2827f43f2d0c177e17faf8ff7720 | [
"MIT"
] | null | null | null | src/simmer/add_dark_exp.py | holdengill/SImMER | 7608a9cb044f2827f43f2d0c177e17faf8ff7720 | [
"MIT"
] | 25 | 2021-01-21T06:51:58.000Z | 2022-03-28T21:07:30.000Z | src/simmer/add_dark_exp.py | holdengill/SImMER | 7608a9cb044f2827f43f2d0c177e17faf8ff7720 | [
"MIT"
] | null | null | null | """
For ShARCS, the darks are often produced by an automated script at
the end of a night. This module adds these frames to the log sheet.
"""
# AS
# Created: 2/11/19
# Updated: 2/11/19
import glob
import os
from ast import literal_eval
import astropy.io.fits as pyfits
import numpy as np
import pandas as pd
from op... | 32.485876 | 80 | 0.558783 |
6d36e457c9c289e00f144c47bf72d7f845d330e5 | 18,060 | py | Python | sdk/python/pulumi_azure_native/network/v20190201/network_profile.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20190201/network_profile.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20190201/network_profile.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"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, overload
from ... import _utilities
fro... | 52.5 | 2,744 | 0.690642 |
38ed775747014c11bcfed59f5c102cfd76b1a66b | 4,728 | py | Python | lib/modules/powershell/collection/SharpChromium.py | terrorizer1980/Empire | 9259e5106986847d2bb770c4289c0c0f1adf2344 | [
"BSD-3-Clause"
] | 49 | 2015-09-02T15:20:09.000Z | 2022-03-05T18:18:23.000Z | lib/modules/powershell/collection/SharpChromium.py | rmusser01/Empire | c1bdbd0fdafd5bf34760d5b158dfd0db2bb19556 | [
"BSD-3-Clause"
] | 1 | 2020-11-04T08:15:12.000Z | 2020-11-04T08:15:12.000Z | lib/modules/powershell/collection/SharpChromium.py | InfinitelyFreedom/Empire | 3a922f60d92658fb716efb3be5a1c15074114766 | [
"BSD-3-Clause"
] | 24 | 2015-09-08T11:45:23.000Z | 2022-02-07T23:53:58.000Z | from __future__ import print_function
from builtins import object
from builtins import str
from lib.common import helpers
class Module(object):
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module... | 36.091603 | 149 | 0.548223 |
63901724fb12aa94a8573a056b4400a552329da7 | 401 | py | Python | api/kittylogs_crud.py | umitkaanusta/kartaca-challenge | 99c1e59b4b95c2e885d59dfaab7e70532e1471cb | [
"MIT"
] | 1 | 2021-11-12T14:09:21.000Z | 2021-11-12T14:09:21.000Z | api/kittylogs_crud.py | umitkaanusta/kartaca-challenge | 99c1e59b4b95c2e885d59dfaab7e70532e1471cb | [
"MIT"
] | null | null | null | api/kittylogs_crud.py | umitkaanusta/kartaca-challenge | 99c1e59b4b95c2e885d59dfaab7e70532e1471cb | [
"MIT"
] | null | null | null | from sqlalchemy.orm import Session
from api import models
def create_log(db: Session, method: str, response_time: int, timestamp: int):
db_log = models.KittyLog()
db_log.method = method
db_log.response_time = response_time
db_log.timestamp = timestamp
db.add(db_log)
db.commit()
db.refresh(... | 23.588235 | 77 | 0.715711 |
6150521fde017afd7ae15541efe3d6d40c27b147 | 649 | py | Python | tests/input/oserror_merge.py | OctoPrint/codemods | 6c6cd4bd689582f906571951b0eb7729c4923b51 | [
"MIT"
] | 5 | 2020-10-06T12:02:23.000Z | 2021-04-26T00:31:55.000Z | tests/input/oserror_merge.py | OctoPrint/codemods | 6c6cd4bd689582f906571951b0eb7729c4923b51 | [
"MIT"
] | null | null | null | tests/input/oserror_merge.py | OctoPrint/codemods | 6c6cd4bd689582f906571951b0eb7729c4923b51 | [
"MIT"
] | 1 | 2020-10-10T17:18:39.000Z | 2020-10-10T17:18:39.000Z | def foo():
pass
try:
foo()
except EnvironmentError:
pass
try:
foo()
except IOError:
pass
try:
foo()
except WindowsError:
pass
try:
foo()
except socket.error:
pass
try:
foo()
except select.error:
pass
try:
foo()
except mmap.error as exc:
pass
try:
foo()
exc... | 10.140625 | 50 | 0.61171 |
76c0e3744f9c449c96bfa2432ed70cc6b1e43acd | 2,041 | py | Python | strikingautumn/taskapp/celery.py | mcenirm/strikingautumn | 04a695ac119621f107d90ff1425763ac165e43ec | [
"MIT"
] | null | null | null | strikingautumn/taskapp/celery.py | mcenirm/strikingautumn | 04a695ac119621f107d90ff1425763ac165e43ec | [
"MIT"
] | null | null | null | strikingautumn/taskapp/celery.py | mcenirm/strikingautumn | 04a695ac119621f107d90ff1425763ac165e43ec | [
"MIT"
] | null | null | null |
from __future__ import absolute_import
import os
from celery import Celery
from django.apps import AppConfig
from django.conf import settings
if not settings.configured:
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local')... | 37.109091 | 99 | 0.704557 |
eac9abd2d4f5c4bf583ddfe5769727a3374743f9 | 3,886 | py | Python | dakimakura_news.py | tom19960222/dakimakura_news | 8c2f0cedc77a01082e5e2f4703490cebfa55befa | [
"MIT"
] | null | null | null | dakimakura_news.py | tom19960222/dakimakura_news | 8c2f0cedc77a01082e5e2f4703490cebfa55befa | [
"MIT"
] | null | null | null | dakimakura_news.py | tom19960222/dakimakura_news | 8c2f0cedc77a01082e5e2f4703490cebfa55befa | [
"MIT"
] | null | null | null | import requests
from bs4 import BeautifulSoup
from feedgen.feed import FeedGenerator
import dateutil.parser
import datetime
import dateutil.tz
from pytz import timezone
import sys
import json
from html.parser import HTMLParser
class MLStripper(HTMLParser):
def __init__(self):
super().__init__()
se... | 31.088 | 217 | 0.631755 |
8a9bd1423e577c8edf7dff0798099d27d4b9f42e | 11,220 | py | Python | instagan/util/visualizer.py | cc-ai/floods-gans | 787dc2a3c08483c68a687b4355c0f0f6f2711ab9 | [
"Apache-2.0"
] | 5 | 2019-05-07T15:14:58.000Z | 2020-11-23T00:21:50.000Z | instagan/util/visualizer.py | cc-ai/floods | 787dc2a3c08483c68a687b4355c0f0f6f2711ab9 | [
"Apache-2.0"
] | 13 | 2019-04-25T01:06:20.000Z | 2022-03-11T23:51:04.000Z | instagan/util/visualizer.py | cc-ai/floods | 787dc2a3c08483c68a687b4355c0f0f6f2711ab9 | [
"Apache-2.0"
] | 4 | 2019-04-24T18:06:10.000Z | 2020-07-15T18:02:56.000Z | import numpy as np
import os
import sys
import ntpath
import time
from . import util
from . import html
from scipy.misc import imresize
import os
import cv2
if sys.version_info[0] == 2:
VisdomExceptionBase = Exception
else:
VisdomExceptionBase = ConnectionError
def save_val_set(results_dir,image_path, visuals... | 43.153846 | 313 | 0.571212 |
31c48d6ab8a44b8e2cd0b61a2989d974e523bf2d | 154 | py | Python | todofehrist/apps.py | z4id/ToDoFehrist | 62fb12fb0545255d06ea32088cbbceafc22f3936 | [
"MIT"
] | null | null | null | todofehrist/apps.py | z4id/ToDoFehrist | 62fb12fb0545255d06ea32088cbbceafc22f3936 | [
"MIT"
] | null | null | null | todofehrist/apps.py | z4id/ToDoFehrist | 62fb12fb0545255d06ea32088cbbceafc22f3936 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class TodofehristConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'todofehrist'
| 22 | 56 | 0.772727 |
61403894ef5a39f3979f0ef1d898c0d23721310b | 4,742 | py | Python | fuzzers/005-tilegrid/add_tdb.py | betrusted-io/prjxray | bdb876caec1385953821bc8b5f28ac395c944ebe | [
"ISC"
] | null | null | null | fuzzers/005-tilegrid/add_tdb.py | betrusted-io/prjxray | bdb876caec1385953821bc8b5f28ac395c944ebe | [
"ISC"
] | null | null | null | fuzzers/005-tilegrid/add_tdb.py | betrusted-io/prjxray | bdb876caec1385953821bc8b5f28ac395c944ebe | [
"ISC"
] | null | null | null | #!/usr/bin/env python3
import json
import util as localutil
import os.path
def check_frames(tagstr, addrlist):
frames = set()
for addrstr in addrlist:
frame = parse_addr(addrstr, get_base_frame=True)
frames.add(frame)
assert len(frames) == 1, (
"{}: More than one base address".for... | 33.871429 | 88 | 0.602699 |
c9154ebd07f05262162a46bb91b3ca9c9abda75c | 6,680 | py | Python | main.py | python-comentado/decorators | ba390ef43922a7481ddf406079e1793aed3c1696 | [
"MIT"
] | 3 | 2021-03-30T12:31:56.000Z | 2021-03-31T15:49:05.000Z | main.py | python-comentado/decorators | ba390ef43922a7481ddf406079e1793aed3c1696 | [
"MIT"
] | null | null | null | main.py | python-comentado/decorators | ba390ef43922a7481ddf406079e1793aed3c1696 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from time import time
import requests
# Vamos inicialmente criar uma função que recebe o nome de um usuário
# do Github (www.github.com) e salva a foto de perfil desse usuário.
def save_image(username):
# o primeiro passo dessa função é fazer uma chamada no endereço
# que guarda a ima... | 45.135135 | 80 | 0.719162 |
baf848eca16214460a3cc390fe4a155828200ecb | 8,938 | py | Python | src/chaonan_src/_doc_retrieval/item_rules_spiral.py | armingh2000/combine-FEVER-NSMN | 5cd4ae0a1da389485f9447939c6a93affa13151b | [
"MIT"
] | 74 | 2018-11-25T21:40:38.000Z | 2022-01-17T04:44:55.000Z | src/chaonan_src/_doc_retrieval/item_rules_spiral.py | Frankey419/combine-FEVER-NSMN | 8577ad47092c052d6c0456415cb2eebc2a392984 | [
"MIT"
] | 8 | 2019-01-09T04:40:18.000Z | 2020-06-28T21:33:49.000Z | src/chaonan_src/_doc_retrieval/item_rules_spiral.py | Frankey419/combine-FEVER-NSMN | 8577ad47092c052d6c0456415cb2eebc2a392984 | [
"MIT"
] | 21 | 2019-01-26T16:45:53.000Z | 2021-08-02T17:02:02.000Z | #!/usr/bin/env python
"""
"""
import re
import json
import numpy as np
import config
from chaonan_src._utils.wiki_pageview_utils import WikiPageviews
from utils import fever_db
from chaonan_src._utils.doc_utils import read_jsonl
from chaonan_src._doc_retrieval.item_rules import ItemRuleBuilderRawID
__all__ = ['Ite... | 39.030568 | 81 | 0.543186 |
9d6a52c6386b7b535ffae9fd9f7e4a4f12106d44 | 1,272 | py | Python | modules/skip_gcn.py | baoyujing/multi_gras | 1bc9b72bee786f5a439c1119a86b6ebaa19bf9f9 | [
"MIT"
] | null | null | null | modules/skip_gcn.py | baoyujing/multi_gras | 1bc9b72bee786f5a439c1119a86b6ebaa19bf9f9 | [
"MIT"
] | null | null | null | modules/skip_gcn.py | baoyujing/multi_gras | 1bc9b72bee786f5a439c1119a86b6ebaa19bf9f9 | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch.nn.functional as F
from modules.graph_convolution import GraphConvolution
class SkipGCN(nn.Module):
def __init__(self, dim_hidden, n_layers=2):
super(SkipGCN, self).__init__()
self.dim_hidden = dim_hidden
self.n_layers = n_layers
self.gcn_list = ... | 31.02439 | 93 | 0.59827 |
d24e1231c3f4d6e49bb0eb6ea13e3a2f3009ca3f | 28,676 | py | Python | google/cloud/metastore_v1beta/services/dataproc_metastore/transports/grpc.py | LaudateCorpus1/python-dataproc-metastore | f8d7bb845079cb98a1f4d18ad68a6b3958541d51 | [
"Apache-2.0"
] | 3 | 2021-12-30T02:18:57.000Z | 2022-03-23T05:54:52.000Z | google/cloud/metastore_v1beta/services/dataproc_metastore/transports/grpc.py | LaudateCorpus1/python-dataproc-metastore | f8d7bb845079cb98a1f4d18ad68a6b3958541d51 | [
"Apache-2.0"
] | 32 | 2021-03-15T21:16:19.000Z | 2022-03-22T15:01:37.000Z | google/cloud/metastore_v1beta/services/dataproc_metastore/transports/grpc.py | LaudateCorpus1/python-dataproc-metastore | f8d7bb845079cb98a1f4d18ad68a6b3958541d51 | [
"Apache-2.0"
] | 2 | 2021-03-15T20:09:18.000Z | 2022-01-29T08:09:24.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 43.186747 | 88 | 0.638653 |
8a575576d68e049e3e261aa1d0b2218f5d768f92 | 1,599 | py | Python | discoPy/rest/stage/stage.py | btschwertfeger/Discord-Websocket-Client | 6c969801f4da670cbf39d12f6a0c39f71f55397c | [
"MIT"
] | null | null | null | discoPy/rest/stage/stage.py | btschwertfeger/Discord-Websocket-Client | 6c969801f4da670cbf39d12f6a0c39f71f55397c | [
"MIT"
] | 3 | 2022-02-28T18:43:21.000Z | 2022-02-28T19:30:20.000Z | discoPy/rest/stage/stage.py | btschwertfeger/Discord-Websocket-Client | 6c969801f4da670cbf39d12f6a0c39f71f55397c | [
"MIT"
] | 2 | 2022-02-28T18:32:58.000Z | 2022-03-30T08:09:23.000Z | from discoPy.rest.base_request.base_request import BaseRequestAPI
class StageData(BaseRequestAPI):
'''Contains a collection of stage related methods.'''
def __init__(self, token: str, url: str=None):
super().__init__(token, url)
def create_stage_instance(self, channel_id, topic: str, privacy_leve... | 51.580645 | 96 | 0.675422 |
49a37b2f1ea166eacfb1198381ea6730c9db9d64 | 37,335 | py | Python | seaborn/regression.py | mmbannert/seaborn | 1d3c30994c8e1d9761a8d2d405a05a55c5f94d46 | [
"BSD-3-Clause"
] | null | null | null | seaborn/regression.py | mmbannert/seaborn | 1d3c30994c8e1d9761a8d2d405a05a55c5f94d46 | [
"BSD-3-Clause"
] | null | null | null | seaborn/regression.py | mmbannert/seaborn | 1d3c30994c8e1d9761a8d2d405a05a55c5f94d46 | [
"BSD-3-Clause"
] | null | null | null | """Plotting functions for linear models (broadly construed)."""
from __future__ import division
import copy
from textwrap import dedent
import warnings
import numpy as np
import pandas as pd
from scipy.spatial import distance
import matplotlib as mpl
import matplotlib.pyplot as plt
try:
import statsmodels
asse... | 35.864553 | 79 | 0.596947 |
caee5097cfb558ae5eb641a27a07cb1492fc8203 | 3,051 | py | Python | cairis/daemon/WebConfig.py | RAIJ95/https-github.com-failys-cairis | 86601347ea016f4a3f90b6942093d63e91de5f74 | [
"Apache-2.0"
] | null | null | null | cairis/daemon/WebConfig.py | RAIJ95/https-github.com-failys-cairis | 86601347ea016f4a3f90b6942093d63e91de5f74 | [
"Apache-2.0"
] | null | null | null | cairis/daemon/WebConfig.py | RAIJ95/https-github.com-failys-cairis | 86601347ea016f4a3f90b6942093d63e91de5f74 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | 29.336538 | 92 | 0.717142 |
c52401084d040c0e6c1e0cbab3715ec5868ca748 | 19,835 | py | Python | mongoengine/base/fields.py | lyft/mongoengine | 7d0c51df68bab7c6cb5b9fb9f36f78c39a9f4b03 | [
"MIT"
] | null | null | null | mongoengine/base/fields.py | lyft/mongoengine | 7d0c51df68bab7c6cb5b9fb9f36f78c39a9f4b03 | [
"MIT"
] | 2 | 2017-03-01T23:16:38.000Z | 2017-03-07T21:47:55.000Z | mongoengine/base/fields.py | lyft/mongoengine | 7d0c51df68bab7c6cb5b9fb9f36f78c39a9f4b03 | [
"MIT"
] | 1 | 2020-12-19T10:46:29.000Z | 2020-12-19T10:46:29.000Z | import operator
import warnings
import weakref
from bson import DBRef, ObjectId, SON
import pymongo
from mongoengine.common import _import_class
from mongoengine.errors import ValidationError
from mongoengine.base.common import ALLOW_INHERITANCE
from mongoengine.base.datastructures import BaseDict, BaseList
__all__... | 38.589494 | 83 | 0.577212 |
c0149586344badc7564612fd88651dc8a9916af0 | 512 | py | Python | rest/usage-triggers/instance-post-example-1/instance-post-example-1.6.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | 3 | 2020-05-05T10:01:02.000Z | 2021-02-06T14:23:13.000Z | rest/usage-triggers/instance-post-example-1/instance-post-example-1.6.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | null | null | null | rest/usage-triggers/instance-post-example-1/instance-post-example-1.6.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | 1 | 2019-10-02T14:36:36.000Z | 2019-10-02T14:36:36.000Z | # Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)
trigger = client.usage.trigg... | 34.133333 | 77 | 0.804688 |
077cca840f68935d92c69072c7307ddde041c399 | 818 | py | Python | tests/util_test.py | NLESC-JCER/pyspectra | b7ece1fff537039f3306b23e00812aa1c8ffc729 | [
"Apache-2.0"
] | 1 | 2021-01-05T01:52:31.000Z | 2021-01-05T01:52:31.000Z | tests/util_test.py | NLESC-JCER/pyspectra | b7ece1fff537039f3306b23e00812aa1c8ffc729 | [
"Apache-2.0"
] | 2 | 2020-07-03T07:54:46.000Z | 2020-07-03T07:59:08.000Z | tests/util_test.py | NLESC-JCER/pyspectra | b7ece1fff537039f3306b23e00812aa1c8ffc729 | [
"Apache-2.0"
] | null | null | null | """Helper functions to tests."""
import numpy as np
def norm(vs: np.array) -> float:
"""Compute the norm of a vector."""
return np.sqrt(np.dot(vs, vs))
def create_random_matrix(size: int) -> np.array:
"""Create a numpy random matrix."""
return np.random.normal(size=size ** 2).reshape(size, size)
... | 27.266667 | 68 | 0.640587 |
6be651004c1d37ffe7e0c02ab396a790970d8c9b | 139 | py | Python | contentcuration/contentcuration/db/models/query.py | Tlazypanda/studio | cd1c2f169c705027cdd808cbbcae907d0a9b21d2 | [
"MIT"
] | 1 | 2019-03-30T18:14:25.000Z | 2019-03-30T18:14:25.000Z | contentcuration/contentcuration/db/models/query.py | Tlazypanda/studio | cd1c2f169c705027cdd808cbbcae907d0a9b21d2 | [
"MIT"
] | 2 | 2019-04-06T07:06:08.000Z | 2019-04-08T23:33:53.000Z | contentcuration/contentcuration/db/models/query.py | Tlazypanda/studio | cd1c2f169c705027cdd808cbbcae907d0a9b21d2 | [
"MIT"
] | 1 | 2020-10-20T05:21:56.000Z | 2020-10-20T05:21:56.000Z | from django_cte import CTEQuerySet
from mptt.querysets import TreeQuerySet
class CustomTreeQuerySet(TreeQuerySet, CTEQuerySet):
pass
| 19.857143 | 52 | 0.834532 |
78a469d295bacefe60741184054eb166df8ab07b | 31,338 | py | Python | magicgui/widgets/_concrete.py | hanjinliu/magicgui | 876190af7be387986138ed5e574e9bd496f2f7a9 | [
"MIT"
] | null | null | null | magicgui/widgets/_concrete.py | hanjinliu/magicgui | 876190af7be387986138ed5e574e9bd496f2f7a9 | [
"MIT"
] | 1 | 2022-02-21T00:33:40.000Z | 2022-02-21T00:33:40.000Z | magicgui/widgets/_concrete.py | hanjinliu/magicgui | 876190af7be387986138ed5e574e9bd496f2f7a9 | [
"MIT"
] | null | null | null | """Widgets backed by a backend implementation, ready to be instantiated by the user.
All of these widgets should provide the `widget_type` argument to their
super().__init__ calls.
"""
from __future__ import annotations
import inspect
import math
import os
import sys
from pathlib import Path
from typing import Any, C... | 30.844488 | 88 | 0.606388 |
74b793481299836ad2fe27c002fc05fcd7bbe4cc | 9,440 | py | Python | hypergan/ops/tensorflow/ops.py | SlipknotTN/HyperGAN | bd39759521d52a706f6f0f561e0c8355a3ef427e | [
"MIT"
] | null | null | null | hypergan/ops/tensorflow/ops.py | SlipknotTN/HyperGAN | bd39759521d52a706f6f0f561e0c8355a3ef427e | [
"MIT"
] | null | null | null | hypergan/ops/tensorflow/ops.py | SlipknotTN/HyperGAN | bd39759521d52a706f6f0f561e0c8355a3ef427e | [
"MIT"
] | null | null | null | import hyperchamber as hc
import tensorflow as tf
import types
import uuid
import importlib
import hypergan
from hypergan.ops.tensorflow import layer_regularizers
from hypergan.ops.tensorflow.activations import lrelu, selu
from hypergan.ops.tensorflow.extended_ops import *
class TensorflowOps:
def __init__(self, c... | 33.35689 | 120 | 0.590784 |
1d9e9fe564ae299909c06662a444f74f2810d175 | 10,222 | py | Python | earthsim/annotators.py | JoshuaQChurch/EarthSim | d42ea719845320c6ad8fbbd22d4fa3e1cf85eabc | [
"BSD-3-Clause"
] | 1 | 2018-09-26T15:33:00.000Z | 2018-09-26T15:33:00.000Z | earthsim/annotators.py | JoshuaQChurch/EarthSim | d42ea719845320c6ad8fbbd22d4fa3e1cf85eabc | [
"BSD-3-Clause"
] | null | null | null | earthsim/annotators.py | JoshuaQChurch/EarthSim | d42ea719845320c6ad8fbbd22d4fa3e1cf85eabc | [
"BSD-3-Clause"
] | 2 | 2018-10-11T10:50:39.000Z | 2019-03-08T09:34:43.000Z | """
Helper functions for building interactive plots that support persistent user annotations.
"""
from functools import partial
import param
import numpy as np
import pandas as pd
import cartopy.crs as ccrs
import geopandas as gpd
import holoviews as hv
import geoviews as gv
import holoviews.plotting.bokeh
from holo... | 38.573585 | 105 | 0.640383 |
f3d6ceb2fcc2a26467e117e7a882959b1a010204 | 1,364 | py | Python | LoadGCodeInjected.py | aleksandarpu/CuraProfileCompare | 28411770da1d3ff31173e80213499ef2f3cfd16a | [
"MIT"
] | 2 | 2021-11-28T18:49:06.000Z | 2021-12-17T21:04:55.000Z | LoadGCodeInjected.py | aleksandarpu/CuraProfileCompare | 28411770da1d3ff31173e80213499ef2f3cfd16a | [
"MIT"
] | null | null | null | LoadGCodeInjected.py | aleksandarpu/CuraProfileCompare | 28411770da1d3ff31173e80213499ef2f3cfd16a | [
"MIT"
] | null | null | null | #######################################################
# CURA (Ultimaker Cura) profile file compare tool
#
# Created by: Aleksandar Putic, 2020
# aleksandarpu@gmali.com
#
# Part of Cura Profile Compare project
#
# Read parameters added to end of gcode file
# as described in CuraSettingsInjector
# source: ht... | 29.021277 | 71 | 0.495601 |
adf8ef95123545bebdfee832ed01848232b4d116 | 37,938 | py | Python | src/sentry/api/helpers/group_index.py | boblail/sentry | 71127331e58791d4651e480b65dd66f06cadc1c8 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/api/helpers/group_index.py | boblail/sentry | 71127331e58791d4651e480b65dd66f06cadc1c8 | [
"BSD-3-Clause"
] | 1 | 2019-03-13T06:05:24.000Z | 2019-03-13T06:05:24.000Z | src/sentry/api/helpers/group_index.py | boblail/sentry | 71127331e58791d4651e480b65dd66f06cadc1c8 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import logging
import six
from collections import defaultdict
from datetime import timedelta
from uuid import uuid4
from django.db import IntegrityError, transaction
from django.utils import timezone
from rest_framework import serializers
from rest_framework.response import Re... | 37.786853 | 100 | 0.570747 |
bd8f766624b9144fac517c16de12b53c51105f56 | 1,289 | py | Python | var/spack/repos/builtin/packages/py-python-swiftclient/package.py | vicentebolea/spack | 0c7fff60651ce3c129551e1c1657ccc80ee816f8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-05-24T15:23:12.000Z | 2020-05-24T15:23:12.000Z | var/spack/repos/builtin/packages/py-python-swiftclient/package.py | vicentebolea/spack | 0c7fff60651ce3c129551e1c1657ccc80ee816f8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 6 | 2022-02-26T11:44:34.000Z | 2022-03-12T12:14:50.000Z | var/spack/repos/builtin/packages/py-python-swiftclient/package.py | vicentebolea/spack | 0c7fff60651ce3c129551e1c1657ccc80ee816f8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-10-29T09:08:17.000Z | 2019-10-29T09:08:17.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyPythonSwiftclient(PythonPackage):
"""This is a python client for the Swift API."""
... | 42.966667 | 101 | 0.717611 |
4824d28958d78336075dd2a27a8ceb802729bbdc | 546 | py | Python | pertemuan_9/1_Filter_Date_Range/instance/config.py | Muhammad-Yunus/Flask-Web-Development | c13e3fda30151b1155242abe4532d5f4d7bc120e | [
"Apache-2.0"
] | null | null | null | pertemuan_9/1_Filter_Date_Range/instance/config.py | Muhammad-Yunus/Flask-Web-Development | c13e3fda30151b1155242abe4532d5f4d7bc120e | [
"Apache-2.0"
] | null | null | null | pertemuan_9/1_Filter_Date_Range/instance/config.py | Muhammad-Yunus/Flask-Web-Development | c13e3fda30151b1155242abe4532d5f4d7bc120e | [
"Apache-2.0"
] | null | null | null | SECRET_KEY = 'qwerty123'
# Create Session config
SESSION_TYPE = 'sqlalchemy'
SESSION_SQLALCHEMY_TABLE = 'sessions'
# Create in-memory database
DATABASE_FILE = 'sample_db.sqlite'
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + DATABASE_FILE
SQLALCHEMY_TRACK_MODIFICATIONS = True
# Create Security Config
SECURITY_PASSWORD_SAL... | 21.84 | 54 | 0.818681 |
d8ec05a643b62cfa39e74b9901447574d7551fc3 | 598 | py | Python | logintestapp/urls.py | jwalit21/Django_Stock_management | d36ed4cb6193031ea5a514aa5d22fdee1e403864 | [
"MIT"
] | 3 | 2020-07-27T07:37:20.000Z | 2021-03-05T12:27:42.000Z | logintestapp/urls.py | jwalit21/Django_Stock_management | d36ed4cb6193031ea5a514aa5d22fdee1e403864 | [
"MIT"
] | null | null | null | logintestapp/urls.py | jwalit21/Django_Stock_management | d36ed4cb6193031ea5a514aa5d22fdee1e403864 | [
"MIT"
] | 1 | 2021-03-03T03:58:29.000Z | 2021-03-03T03:58:29.000Z | from django.urls import path
from . import views
urlpatterns=[
path('login/',views.login),
path('auth/',views.auth_view),
path('loggedin/',views.loggedin),
path('logout/',views.logout),
path('invalidlogin/',views.invalidlogin),
path('addCustomer/',views.newCustomer),
path('createUser/',view... | 37.375 | 80 | 0.737458 |
b46e4bfb86bd5dc9c74375693328f2506281be3e | 5,785 | py | Python | python/paddle/fluid/tests/unittests/test_sgd_op.py | xuezhong/Paddle | be9ec5208160bfed02e767bdb23db5aba9cf5eb0 | [
"Apache-2.0"
] | 9 | 2017-12-04T02:58:01.000Z | 2020-12-03T14:46:30.000Z | python/paddle/fluid/tests/unittests/test_sgd_op.py | xuezhong/Paddle | be9ec5208160bfed02e767bdb23db5aba9cf5eb0 | [
"Apache-2.0"
] | 7 | 2017-12-05T20:29:08.000Z | 2018-10-15T08:57:40.000Z | python/paddle/fluid/tests/unittests/test_sgd_op.py | xuezhong/Paddle | be9ec5208160bfed02e767bdb23db5aba9cf5eb0 | [
"Apache-2.0"
] | 6 | 2018-03-19T22:38:46.000Z | 2019-11-01T22:28:27.000Z | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 33.633721 | 75 | 0.617286 |
6dda2e63a9dd072e37c8233534cb441506b1caee | 4,963 | py | Python | sdk/python/tests/integration/offline_store/test_feature_logging.py | ibnummuhammad/feast | 1fd9c2def1fbaca68e865a7c67336793ddb25582 | [
"Apache-2.0"
] | null | null | null | sdk/python/tests/integration/offline_store/test_feature_logging.py | ibnummuhammad/feast | 1fd9c2def1fbaca68e865a7c67336793ddb25582 | [
"Apache-2.0"
] | null | null | null | sdk/python/tests/integration/offline_store/test_feature_logging.py | ibnummuhammad/feast | 1fd9c2def1fbaca68e865a7c67336793ddb25582 | [
"Apache-2.0"
] | null | null | null | import contextlib
import datetime
import tempfile
import uuid
from pathlib import Path
from typing import Iterator, Union
import numpy as np
import pandas as pd
import pyarrow
import pyarrow as pa
import pytest
from google.api_core.exceptions import NotFound
from feast.feature_logging import (
LOG_DATE_FIELD,
... | 33.993151 | 92 | 0.706629 |
5ed706be5f55b49ff2279bd71c555be7af92e4fd | 879 | py | Python | Lib/test/test_codecmaps_cn.py | raychorn/svn_Python-2.5.1 | 425005b1b489ba44ec0bb989e077297e8953d9be | [
"PSF-2.0"
] | null | null | null | Lib/test/test_codecmaps_cn.py | raychorn/svn_Python-2.5.1 | 425005b1b489ba44ec0bb989e077297e8953d9be | [
"PSF-2.0"
] | null | null | null | Lib/test/test_codecmaps_cn.py | raychorn/svn_Python-2.5.1 | 425005b1b489ba44ec0bb989e077297e8953d9be | [
"PSF-2.0"
] | null | null | null | #!/usr/bin/env python
#
# test_codecmaps_cn.py
# Codec mapping tests for PRC encodings
#
from test import test_support
from test import test_multibytecodec_support
import unittest
class TestGB2312Map(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase):
encoding = 'gb2... | 29.3 | 69 | 0.690557 |
d61b99ed6428a1f9fb9d7d0caba30872a41e12fb | 936 | py | Python | 14.py | vaultah/AoC-2016 | ac262a44e90f2c3499f8eb6af5b214674677b560 | [
"MIT"
] | 1 | 2017-12-05T14:26:46.000Z | 2017-12-05T14:26:46.000Z | 14.py | vaultah/Advent-of-Code-2016 | ac262a44e90f2c3499f8eb6af5b214674677b560 | [
"MIT"
] | null | null | null | 14.py | vaultah/Advent-of-Code-2016 | ac262a44e90f2c3499f8eb6af5b214674677b560 | [
"MIT"
] | null | null | null | # Day 14: http://adventofcode.com/2016/day/14
from itertools import count
from hashlib import md5
from functools import lru_cache
inp = 'qzyelonm'
@lru_cache(maxsize=None)
def digest(salt, index, rounds=1):
s = f'{salt}{index}'
for _ in range(rounds):
s = md5(s.encode()).hexdigest()
return s
... | 25.297297 | 88 | 0.563034 |
13f184eba9ca28b4017eee541f28fe4bbacc7020 | 1,111 | py | Python | problems/CR/auto/problem29_CR.py | sunandita/ICAPS_Summer_School_RAE_2020 | a496b62185bcfdd2c76eb7986ae99cfa85708d28 | [
"BSD-3-Clause"
] | 5 | 2020-10-15T14:40:03.000Z | 2021-08-20T17:45:41.000Z | problems/CR/auto/problem29_CR.py | sunandita/ICAPS_Summer_School_RAE_2020 | a496b62185bcfdd2c76eb7986ae99cfa85708d28 | [
"BSD-3-Clause"
] | null | null | null | problems/CR/auto/problem29_CR.py | sunandita/ICAPS_Summer_School_RAE_2020 | a496b62185bcfdd2c76eb7986ae99cfa85708d28 | [
"BSD-3-Clause"
] | 2 | 2020-10-15T07:06:14.000Z | 2020-10-15T17:33:01.000Z | __author__ = 'patras'
from domain_chargeableRobot import *
from timer import DURATION
from state import state
DURATION.TIME = {
'put': 2,
'take': 2,
'perceive': 3,
'charge': 5,
'move': 10,
'moveToEmergency': 5,
'moveCharger': 15,
'addressEmergency': 10,
'wait': 5,
}
DURATION.COUNTE... | 21.365385 | 93 | 0.50315 |
6dd4f5293a9745a751c287857005d7f02650c14c | 87,604 | py | Python | lib/matplotlib/pyplot.py | fperez/matplotlib | 86774fc290ce0bf6d4263771856571044f66bdd0 | [
"MIT",
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2015-05-07T16:53:21.000Z | 2015-05-07T16:53:21.000Z | lib/matplotlib/pyplot.py | fperez/matplotlib | 86774fc290ce0bf6d4263771856571044f66bdd0 | [
"MIT",
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | lib/matplotlib/pyplot.py | fperez/matplotlib | 86774fc290ce0bf6d4263771856571044f66bdd0 | [
"MIT",
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | """
Provides a MATLAB-like plotting framework.
:mod:`~matplotlib.pylab` combines pyplot with numpy into a single namespace.
This is convenient for interactive work, but for programming it
is recommended that the namespaces be kept separate, e.g.::
import numpy as np
import matplotlib.pyplot as plt
x = np... | 29.777022 | 267 | 0.636569 |
dcf4861da5734f15a4ce47cf9aa2b759e66e93bf | 3,458 | py | Python | azure-mgmt-datafactory/azure/mgmt/datafactory/models/azure_my_sql_linked_service_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-datafactory/azure/mgmt/datafactory/models/azure_my_sql_linked_service_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-datafactory/azure/mgmt/datafactory/models/azure_my_sql_linked_service_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 48.027778 | 209 | 0.686813 |
7f50c4dddd2a6a9132f86c4a83ec654a0bea55a0 | 975 | py | Python | py/g1/containers/tests/fixtures.py | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | 3 | 2016-01-04T06:28:52.000Z | 2020-09-20T13:18:40.000Z | py/g1/containers/tests/fixtures.py | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | null | null | null | py/g1/containers/tests/fixtures.py | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | null | null | null | import unittest
import unittest.mock
import tempfile
from pathlib import Path
from g1.containers import bases
class TestCaseBase(unittest.TestCase):
def setUp(self):
super().setUp()
unittest.mock.patch('g1.bases.oses.assert_group_exist').start()
unittest.mock.patch('g1.bases.oses.assert... | 31.451613 | 74 | 0.70359 |
5c37e29e375548ad119fd24ea22bc5e2ed02e370 | 2,152 | py | Python | algorithm_mic_sdk/tools.py | panyunsuo/AlgorithmicMicroserviceSDK | e7094a0a2a55b7bc7f65765bfb3918fc1fa305cc | [
"MIT"
] | null | null | null | algorithm_mic_sdk/tools.py | panyunsuo/AlgorithmicMicroserviceSDK | e7094a0a2a55b7bc7f65765bfb3918fc1fa305cc | [
"MIT"
] | null | null | null | algorithm_mic_sdk/tools.py | panyunsuo/AlgorithmicMicroserviceSDK | e7094a0a2a55b7bc7f65765bfb3918fc1fa305cc | [
"MIT"
] | null | null | null | import hashlib
from functools import lru_cache
import requests
def get_md5(data):
md5_obj = hashlib.md5()
if not isinstance(data, bytes):
data = str(data).encode()
md5_obj.update(data)
hash_code = md5_obj.hexdigest()
return hash_code
class FileInfo(object):
"""
文件对象,在所有需要上传文件的地方... | 26.9 | 99 | 0.639405 |
a80b1357f66e4f55471732e1e2e9c875f418c0d5 | 1,030 | py | Python | tests/test_correct_index_dict.py | burkesquires/FeaVar | 68695bff105fbabbda18f27b0d296f7f446ca0bb | [
"CC0-1.0"
] | 1 | 2019-10-28T16:58:34.000Z | 2019-10-28T16:58:34.000Z | tests/test_correct_index_dict.py | burkesquires/nvariant | 68695bff105fbabbda18f27b0d296f7f446ca0bb | [
"CC0-1.0"
] | 1 | 2021-09-03T13:37:57.000Z | 2021-09-03T20:40:55.000Z | tests/test_correct_index_dict.py | burkesquires/ombre | 68695bff105fbabbda18f27b0d296f7f446ca0bb | [
"CC0-1.0"
] | null | null | null | from unittest import TestCase
class TestCorrectIndexDict(TestCase):
def test_correct_index_dict(self):
from FeaVar.FeaVar import correct_index_dict
# Do I need to test for an empy sequence?
test_ref_seq = "-M---SP---QTE----TKAS-"
corrected_positions = correct_index_dict(test_ref... | 44.782609 | 118 | 0.53301 |
70a3edae63440b6e409dba8a83cadcd6b0ac126b | 270 | py | Python | hooks/pre_gen_project.py | epandurski/cookiecutter-flask-signalbus | 17f0ba711205a334359643421fc7184a6f84ff32 | [
"MIT"
] | null | null | null | hooks/pre_gen_project.py | epandurski/cookiecutter-flask-signalbus | 17f0ba711205a334359643421fc7184a6f84ff32 | [
"MIT"
] | null | null | null | hooks/pre_gen_project.py | epandurski/cookiecutter-flask-signalbus | 17f0ba711205a334359643421fc7184a6f84ff32 | [
"MIT"
] | null | null | null | import re
import sys
MODULE_REGEX = r'^[_a-zA-Z][_a-zA-Z0-9]+$'
module_name = '{{cookiecutter.app_slug}}'
if not re.match(MODULE_REGEX, module_name):
print(
'ERROR: The app slug (%s) is not a valid Python module name.' % module_name
)
sys.exit(1)
| 20.769231 | 83 | 0.648148 |
35c5e10d8d15d2345114298d5cc5a9f622b525b6 | 87,008 | py | Python | salt/master.py | kaptk2/salt | 8b06fff072c20d77f3447d8521a4667413218ab3 | [
"Apache-2.0"
] | 1 | 2015-06-05T13:47:02.000Z | 2015-06-05T13:47:02.000Z | salt/master.py | kaptk2/salt | 8b06fff072c20d77f3447d8521a4667413218ab3 | [
"Apache-2.0"
] | null | null | null | salt/master.py | kaptk2/salt | 8b06fff072c20d77f3447d8521a4667413218ab3 | [
"Apache-2.0"
] | null | null | null | '''
This module contains all of the routines needed to set up a master server, this
involves preparing the three listeners and the workers needed by the master.
'''
# Import python libs
import os
import re
import time
import errno
import fnmatch
import signal
import shutil
import stat
import logging
import hashlib
imp... | 38.363316 | 194 | 0.505953 |
288c17c9511c203d1bb7210183eb112a13960e6d | 4,622 | py | Python | python/paddle/utils/profiler.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 11 | 2016-08-29T07:43:26.000Z | 2016-08-29T07:51:24.000Z | python/paddle/utils/profiler.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | null | null | null | python/paddle/utils/profiler.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 1 | 2021-12-09T08:59:17.000Z | 2021-12-09T08:59:17.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 31.875862 | 80 | 0.602986 |
517941c1905f0d8adb2402bdd2e80863d5a67ac7 | 1,008 | py | Python | topi/python/topi/arm_cpu/__init__.py | robo-corg/incubator-tvm | 4ddfdb4b15d05a5bf85a984837967d004efee5dd | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | topi/python/topi/arm_cpu/__init__.py | robo-corg/incubator-tvm | 4ddfdb4b15d05a5bf85a984837967d004efee5dd | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | topi/python/topi/arm_cpu/__init__.py | robo-corg/incubator-tvm | 4ddfdb4b15d05a5bf85a984837967d004efee5dd | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.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... | 37.333333 | 62 | 0.776786 |
f9b874abe9b76eef5d65aa13e4ad4b81c76558b6 | 4,811 | py | Python | vendor/munkireport/munkiinfo/scripts/munkiinfo.py | menamegaly/MR | 18d042639d9b45ca81a9b58659f45c6e2c3ac87f | [
"MIT"
] | null | null | null | vendor/munkireport/munkiinfo/scripts/munkiinfo.py | menamegaly/MR | 18d042639d9b45ca81a9b58659f45c6e2c3ac87f | [
"MIT"
] | null | null | null | vendor/munkireport/munkiinfo/scripts/munkiinfo.py | menamegaly/MR | 18d042639d9b45ca81a9b58659f45c6e2c3ac87f | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
munkiinfo for munkireport
"""
import os
import plistlib
import sys
import urlparse
import importlib
# pylint: disable=E0611
from Foundation import CFPreferencesCopyAppValue
# pylint: enable=E0611
sys.path.append('/usr/local/munki')
try:
from munkilib import prefs
except ImportError:
# L... | 29.157576 | 94 | 0.652671 |
95f52ff395b60423d3fa7023fc99666b1946793c | 36,664 | py | Python | sympy/functions/elementary/complexes.py | staaker/sympy | 946be880abad6186c74eb3a10d608bebbcaf0851 | [
"BSD-3-Clause"
] | 2 | 2020-06-12T10:22:12.000Z | 2020-11-20T12:31:12.000Z | sympy/functions/elementary/complexes.py | rahulkumaran/sympy | 2d4eb2fd9f8333bb1992c31069f256db542b589b | [
"BSD-3-Clause"
] | null | null | null | sympy/functions/elementary/complexes.py | rahulkumaran/sympy | 2d4eb2fd9f8333bb1992c31069f256db542b589b | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function, division
from sympy.core import S, Add, Mul, sympify, Symbol, Dummy, Basic
from sympy.core.expr import Expr
from sympy.core.exprtools import factor_terms
from sympy.core.function import (Function, Derivative, ArgumentIndexError,
AppliedUndef)
from sympy.core.logic import fuzz... | 31.018613 | 81 | 0.553622 |
e45f1939d05784579ec4819b47b3e3247e10431f | 23,243 | py | Python | netpyne/sim/load.py | sanjayankur31/netpyne | d8b7e94cabeb27e23e30853ff17ae86518b35ac2 | [
"MIT"
] | null | null | null | netpyne/sim/load.py | sanjayankur31/netpyne | d8b7e94cabeb27e23e30853ff17ae86518b35ac2 | [
"MIT"
] | null | null | null | netpyne/sim/load.py | sanjayankur31/netpyne | d8b7e94cabeb27e23e30853ff17ae86518b35ac2 | [
"MIT"
] | null | null | null | """
Module for loading of data and simulations
"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import open
from builtins import range
# required to make json saving work in Python 2/3
try:
to_u... | 36.545597 | 187 | 0.525147 |
3e3fe8f3b202d9164c6979337540b00fa6d99480 | 2,400 | py | Python | test/scripts/test_redirect.py | fujiehuang/ecto | fea744337aa1fad1397c9a3ba5baa143993cb5eb | [
"BSD-3-Clause"
] | null | null | null | test/scripts/test_redirect.py | fujiehuang/ecto | fea744337aa1fad1397c9a3ba5baa143993cb5eb | [
"BSD-3-Clause"
] | null | null | null | test/scripts/test_redirect.py | fujiehuang/ecto | fea744337aa1fad1397c9a3ba5baa143993cb5eb | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2011, Willow Garage, 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
# n... | 35.820896 | 77 | 0.71625 |
c04799b5bb0df684e30f7b4a504a8038d2fd06fa | 8,697 | py | Python | _broken/oldpipe.py | SU-ECE-17-7/ibeis | b12a45b06d8ce8f52585494c15f6776f5889ed67 | [
"Apache-2.0"
] | null | null | null | _broken/oldpipe.py | SU-ECE-17-7/ibeis | b12a45b06d8ce8f52585494c15f6776f5889ed67 | [
"Apache-2.0"
] | null | null | null | _broken/oldpipe.py | SU-ECE-17-7/ibeis | b12a45b06d8ce8f52585494c15f6776f5889ed67 | [
"Apache-2.0"
] | null | null | null | fsv
def get_sparse_matchinfo_agg(qreq_, qfx2_idx, nnfiltagg):
# OLD WAY OF DOING THINGS
K = qreq_.qparams.K
# Build feature matches
qfx2_nnidx = qfx2_idx.T[0:K].T
qfx2_daid = qreq_.indexer.get_nn_aids(qfx2_nnidx)
qfx2_dfx = qreq_.indexer.get_nn_featxs(qfx2_nnidx)
# Unpack filter scores and f... | 49.135593 | 114 | 0.641601 |
d634047ba82010b1c31b7e2df032bbe48c60fb3b | 1,221 | py | Python | test/test_delete_contact_from_group.py | miaowization/PythonTraining | 32ff6ceedc3ba15efbc86b1bb8afbf65060690a1 | [
"Apache-2.0"
] | null | null | null | test/test_delete_contact_from_group.py | miaowization/PythonTraining | 32ff6ceedc3ba15efbc86b1bb8afbf65060690a1 | [
"Apache-2.0"
] | null | null | null | test/test_delete_contact_from_group.py | miaowization/PythonTraining | 32ff6ceedc3ba15efbc86b1bb8afbf65060690a1 | [
"Apache-2.0"
] | null | null | null | from datetime import time
from random import randrange
from model.contact import Contact
from model.group import Group
import random
from fixture.orm import ORMFixture
db_orm = ORMFixture(host="127.0.0.1", name="addressbook", user="root", password="")
def test_delete_contact_from_group(app, db, check_ui):
if len... | 42.103448 | 106 | 0.731368 |
070c1fc2fc3eca4a9277738572602324b572256b | 36,937 | py | Python | tests/test_overdrive.py | NYPL/Simplified-server-core | d924b0cfb687f8c1eaaf731e510dd9196a77b0b2 | [
"Apache-2.0"
] | 8 | 2017-05-15T13:58:57.000Z | 2020-09-01T19:28:44.000Z | tests/test_overdrive.py | NYPL/Simplified-server-core | d924b0cfb687f8c1eaaf731e510dd9196a77b0b2 | [
"Apache-2.0"
] | 621 | 2016-01-26T17:10:56.000Z | 2022-03-29T20:51:40.000Z | tests/test_overdrive.py | NYPL/Simplified-server-core | d924b0cfb687f8c1eaaf731e510dd9196a77b0b2 | [
"Apache-2.0"
] | 16 | 2016-09-02T14:59:44.000Z | 2021-02-26T15:30:03.000Z | # encoding: utf-8
import pytest
import os
import json
import pkgutil
from ..overdrive import (
OverdriveAPI,
MockOverdriveAPI,
OverdriveAdvantageAccount,
OverdriveRepresentationExtractor,
OverdriveBibliographicCoverageProvider,
)
from ..coverage import (
CoverageFailure,
)
from ..config impor... | 41.270391 | 259 | 0.663887 |
3b32e9dd9362bb03d69d932838b92fba91264fab | 2,159 | py | Python | continuous_delivery/models/provisioning_configuration_target.py | kuvinodms/microsoft-pycon-demo | a4e0426217f0e6a1f0a636f1b46b41a530d44b13 | [
"MIT"
] | null | null | null | continuous_delivery/models/provisioning_configuration_target.py | kuvinodms/microsoft-pycon-demo | a4e0426217f0e6a1f0a636f1b46b41a530d44b13 | [
"MIT"
] | null | null | null | continuous_delivery/models/provisioning_configuration_target.py | kuvinodms/microsoft-pycon-demo | a4e0426217f0e6a1f0a636f1b46b41a530d44b13 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------... | 51.404762 | 160 | 0.621121 |
df8b6713e4681c55da2a92da115eb2cf7dc64547 | 3,381 | py | Python | code/vocabulary.py | davidulander/knausj_talon | 6032a5c94d39ee970b82c8ff3404e8b65c08eaef | [
"MIT"
] | null | null | null | code/vocabulary.py | davidulander/knausj_talon | 6032a5c94d39ee970b82c8ff3404e8b65c08eaef | [
"MIT"
] | null | null | null | code/vocabulary.py | davidulander/knausj_talon | 6032a5c94d39ee970b82c8ff3404e8b65c08eaef | [
"MIT"
] | null | null | null | from talon import Context, Module, actions, grammar
from .user_settings import bind_list_to_csv, bind_word_map_to_csv
mod = Module()
ctx = Context()
mod.list("vocabulary", desc="additional vocabulary words")
@mod.capture(rule="({user.vocabulary} | <word>)")
def word(m) -> str:
try:
return m.vocabulary
... | 28.897436 | 92 | 0.667258 |
48b6cfb46b2c1aec3ec1a3d628e82cfc3dad4754 | 6,035 | py | Python | docs/conf.py | rickh94/airtable_local_backup | 69dfc1aef30cd92a3f8e0ddc0cae8a9ba5122243 | [
"MIT"
] | 29 | 2017-10-23T07:57:52.000Z | 2021-11-10T01:39:24.000Z | docs/conf.py | rickh94/airtable_local_backup | 69dfc1aef30cd92a3f8e0ddc0cae8a9ba5122243 | [
"MIT"
] | 2 | 2018-10-18T15:36:53.000Z | 2019-11-22T07:28:19.000Z | docs/conf.py | rickh94/airtable_local_backup | 69dfc1aef30cd92a3f8e0ddc0cae8a9ba5122243 | [
"MIT"
] | 8 | 2018-05-23T12:01:38.000Z | 2022-03-02T17:41:16.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Airtable Local Backup documentation build configuration file, created by
# sphinx-quickstart on Sat Oct 28 22:49:56 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are presen... | 31.432292 | 91 | 0.694449 |
b16a99323609fa4bb0d821a386b6aacb95c450d1 | 7,568 | py | Python | Test/morePing.py | mstxq17/MorePing | 1033eb737fa7a692ea3c9748cc8d832ca5efe291 | [
"MIT"
] | 17 | 2020-08-05T10:35:52.000Z | 2022-02-14T06:51:14.000Z | Test/morePing.py | mstxq17/MorePing | 1033eb737fa7a692ea3c9748cc8d832ca5efe291 | [
"MIT"
] | 4 | 2020-12-01T11:39:35.000Z | 2022-01-24T18:58:44.000Z | Test/morePing.py | mstxq17/MorePing | 1033eb737fa7a692ea3c9748cc8d832ca5efe291 | [
"MIT"
] | 7 | 2020-09-07T08:35:45.000Z | 2022-01-24T18:58:49.000Z | #!/usr/bin/python3
# -*- coding:utf-8 -*-
import os, sys, re
import threading, gevent
import queue
import json
from argparse import ArgumentParser, RawTextHelpFormatter
from alive_progress import alive_bar
from gevent import monkey
monkey.patch_all()
import requests
import time
# global variables
task_queue = queue... | 29.220077 | 96 | 0.54149 |
27a3027c6c619ade532a75ea5616d9a9e72d18bf | 506 | py | Python | artifice/windows/annotator_window.py | zhuokaizhao/artifice | ed6d80ad4fe5a56d8f2ae661cf702eeea18439e4 | [
"Apache-2.0"
] | 2 | 2019-09-30T14:48:18.000Z | 2019-09-30T18:17:36.000Z | artifice/windows/annotator_window.py | zhuokaizhao/artifice | ed6d80ad4fe5a56d8f2ae661cf702eeea18439e4 | [
"Apache-2.0"
] | null | null | null | artifice/windows/annotator_window.py | zhuokaizhao/artifice | ed6d80ad4fe5a56d8f2ae661cf702eeea18439e4 | [
"Apache-2.0"
] | 1 | 2019-10-18T02:53:50.000Z | 2019-10-18T02:53:50.000Z | """Create the annotator window for use by ann.py."""
from PyQt5.QtWidgets import QApplication, QLabel, QMainWindow, QWidget
from PyQt5.QtGui import QIcon, QPixmap
from PyQt5.QtCore import Qt
class AnnotatorWindow(QWidget):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.setWindo... | 20.24 | 70 | 0.685771 |
b6187e7f951b135608f177d07cdf4d5b967ecdf8 | 1,075 | py | Python | src/patrollers/astar.py | liam-prevelige/amp | 3f5d8fdbb1078b7a245dbe9e7a8fb38c6bdc453f | [
"AAL"
] | 1 | 2021-06-29T03:49:48.000Z | 2021-06-29T03:49:48.000Z | src/patrollers/astar.py | liam-prevelige/autonomous-multirobot-patrol | 3f5d8fdbb1078b7a245dbe9e7a8fb38c6bdc453f | [
"AAL"
] | null | null | null | src/patrollers/astar.py | liam-prevelige/autonomous-multirobot-patrol | 3f5d8fdbb1078b7a245dbe9e7a8fb38c6bdc453f | [
"AAL"
] | null | null | null | from math import sqrt
inf = 9999999999
def hypot(x, y):
return sqrt(x ** 2 + y ** 2)
def heuristic_cost_estimate(src, dest):
return hypot(dest[0] - src[0], dest[1] - src[1])
# Adapted from https://github.com/mlyean/grid-pathfinding/blob/master/astar.py
def a_star(grid, src, dest):
nodes = grid.get_nodes()
clos... | 19.545455 | 78 | 0.657674 |
649a7a4784371f3847b9fe5dc3c899dbff9e758f | 1,021 | py | Python | tests/test_utils.py | dgilland/sqlservice | 369dfa5d1f95aae7129ff793006d70ce666d0dbc | [
"MIT"
] | 166 | 2016-05-22T01:00:36.000Z | 2022-03-27T13:10:57.000Z | tests/test_utils.py | dgilland/sqlservice | 369dfa5d1f95aae7129ff793006d70ce666d0dbc | [
"MIT"
] | 35 | 2016-09-14T16:38:32.000Z | 2022-03-11T16:00:15.000Z | tests/test_utils.py | dgilland/sqlservice | 369dfa5d1f95aae7129ff793006d70ce666d0dbc | [
"MIT"
] | 12 | 2016-11-30T06:19:16.000Z | 2021-07-31T18:35:56.000Z | import pytest
from sqlservice.utils import FrozenDict
def test_frozendict_getitem():
frozen_d = FrozenDict({"a": 1})
assert frozen_d["a"] == frozen_d._dict["a"]
def test_frozendict_immutability():
frozen_d = FrozenDict()
with pytest.raises(TypeError):
frozen_d["a"] = 1 # pylint: disable=un... | 23.744186 | 77 | 0.674829 |
d695b7d66cdc08035660b0a0e6a731842128ccc5 | 11,168 | py | Python | dolfyn/adv/_readascii.py | aidanbharath/dolfyn | 7c8c62a780ae310b1ffdf04592fa77f400b04334 | [
"Apache-2.0"
] | 28 | 2016-03-07T16:31:34.000Z | 2022-03-29T03:28:36.000Z | dolfyn/adv/_readascii.py | aidanbharath/dolfyn | 7c8c62a780ae310b1ffdf04592fa77f400b04334 | [
"Apache-2.0"
] | 85 | 2015-09-04T15:51:26.000Z | 2022-03-29T20:45:08.000Z | dolfyn/adv/_readascii.py | aidanbharath/dolfyn | 7c8c62a780ae310b1ffdf04592fa77f400b04334 | [
"Apache-2.0"
] | 27 | 2016-04-02T04:02:10.000Z | 2022-03-26T02:45:06.000Z | from . import base as adv
import os
from ..tools import misc as tbx
from ..data import time
import string
import numpy as np
from six import string_types
alphs = set(string.ascii_letters).union(['(', ')', '%'])
def count_lines(fd):
"""
!!! This function assumes each line has the same number of bytes!!!
... | 31.548023 | 77 | 0.455408 |
4c1f0b738b36c0b2114eedba5ddcd672cf9800ac | 1,951 | py | Python | src/unittest/python/timSort_tests.py | asifkamalturzo/visualizer_integration | 20f0f83bff3bba0f5cf52061f65aef33ada46a89 | [
"MIT"
] | null | null | null | src/unittest/python/timSort_tests.py | asifkamalturzo/visualizer_integration | 20f0f83bff3bba0f5cf52061f65aef33ada46a89 | [
"MIT"
] | null | null | null | src/unittest/python/timSort_tests.py | asifkamalturzo/visualizer_integration | 20f0f83bff3bba0f5cf52061f65aef33ada46a89 | [
"MIT"
] | null | null | null | import unittest
from algorithms.timSort import timSort
class TimSortTest(unittest.TestCase):
def test_empty_list(self):
inputArray = [0]
expectedOutput = [([0], 0, -1, 0, 0)]
OutputArray = list(timSort(inputArray, 0, len(inputArray)-1))
self.assertEqual(expectedOutput, OutputArra... | 32.516667 | 75 | 0.627883 |
ca81ef7e8cc5fc78dd52d6ba9b4e993d53ce6a77 | 991 | py | Python | test_scripts/test_dialo.py | greerviau/VirtualAssistant | 31c0ec72ff2d89c36036f97d4f21a4b2656169ef | [
"MIT"
] | null | null | null | test_scripts/test_dialo.py | greerviau/VirtualAssistant | 31c0ec72ff2d89c36036f97d4f21a4b2656169ef | [
"MIT"
] | null | null | null | test_scripts/test_dialo.py | greerviau/VirtualAssistant | 31c0ec72ff2d89c36036f97d4f21a4b2656169ef | [
"MIT"
] | null | null | null | from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
tokenizer = AutoTokenizer.from_pretrained("microsoft/DialoGPT-large")
model = AutoModelForCausalLM.from_pretrained("microsoft/DialoGPT-large")
# Let's chat for 5 lines
for step in range(10):
# encode the new user input, add the eos_token a... | 49.55 | 126 | 0.771948 |
6c243c8a8b0144034203396132770f47f7355fff | 406 | py | Python | chequeconvert/main.py | pirsquare/chequeconvert-python | bdd4f30a11ac56c3b6e1d5c387531e479f507d65 | [
"MIT"
] | null | null | null | chequeconvert/main.py | pirsquare/chequeconvert-python | bdd4f30a11ac56c3b6e1d5c387531e479f507d65 | [
"MIT"
] | null | null | null | chequeconvert/main.py | pirsquare/chequeconvert-python | bdd4f30a11ac56c3b6e1d5c387531e479f507d65 | [
"MIT"
] | null | null | null | import sys
import argparse
from .base import generate_word
def main():
parser = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument("amount", type=str,
help="Amount to convert in str... | 31.230769 | 90 | 0.657635 |
03fadbb49df6d3dfc3c82bbd030ba3525adaef78 | 2,996 | py | Python | sgkit/tests/io/vcf/test_utils.py | timothymillar/sgkit | a3a5e961b6b21ff7de235075955c0f797ad5027c | [
"Apache-2.0"
] | 1 | 2020-07-02T22:31:49.000Z | 2020-07-02T22:31:49.000Z | sgkit/tests/io/vcf/test_utils.py | timothymillar/sgkit | a3a5e961b6b21ff7de235075955c0f797ad5027c | [
"Apache-2.0"
] | 2 | 2021-05-16T16:09:22.000Z | 2021-06-15T21:03:56.000Z | sgkit/tests/io/vcf/test_utils.py | timothymillar/sgkit | a3a5e961b6b21ff7de235075955c0f797ad5027c | [
"Apache-2.0"
] | 1 | 2021-05-15T05:01:41.000Z | 2021-05-15T05:01:41.000Z | import os
import tempfile
from pathlib import Path
import fsspec
import pytest
from callee.strings import StartsWith
from sgkit.io.vcf.utils import build_url, temporary_directory
def directory_with_file_scheme() -> str:
return f"file://{tempfile.gettempdir()}"
def directory_with_missing_parent() -> str:
#... | 32.565217 | 87 | 0.662216 |
b133594c609edde799f471789d6b7af980ee99bc | 10,112 | py | Python | arnold/src/model/dqn/base.py | sid230798/Doom_Reinforcement_Learning | eb4972a54389e0f9d07a34c302ec6e6256c6084d | [
"MIT"
] | 2 | 2019-05-13T11:06:46.000Z | 2019-05-13T11:17:34.000Z | arnold/src/model/dqn/base.py | sid230798/Doom_Reinforcement_Learning | eb4972a54389e0f9d07a34c302ec6e6256c6084d | [
"MIT"
] | null | null | null | arnold/src/model/dqn/base.py | sid230798/Doom_Reinforcement_Learning | eb4972a54389e0f9d07a34c302ec6e6256c6084d | [
"MIT"
] | null | null | null | import copy
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
from logging import getLogger
from ...utils import bool_flag
from ..utils import value_loss, build_CNN_network, weighted_mse_loss, abs_mse_loss, init_weights
from ..utils import build_game_variables_network, build_ga... | 37.731343 | 206 | 0.610463 |
96201b5825f7aef02a9830224d8692c38fe72cfe | 22,895 | py | Python | common/train_network_ao.py | BlueVelvetSackOfGoldPotatoes/medicalMRIcnn | 8fc7afd11dd2452bffd8389ea99d2bc82ef5bc75 | [
"Apache-2.0"
] | null | null | null | common/train_network_ao.py | BlueVelvetSackOfGoldPotatoes/medicalMRIcnn | 8fc7afd11dd2452bffd8389ea99d2bc82ef5bc75 | [
"Apache-2.0"
] | null | null | null | common/train_network_ao.py | BlueVelvetSackOfGoldPotatoes/medicalMRIcnn | 8fc7afd11dd2452bffd8389ea99d2bc82ef5bc75 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018, Wenjia Bai. 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 ... | 46.915984 | 128 | 0.572483 |
d0164903f2709761984344c7be25c7e678780523 | 8,630 | py | Python | libs/baseclass/dialog_change_theme.py | biplobsd/proxySpeedTestApp | b436fa48da923ce0908f853406ca27d207a0d679 | [
"MIT"
] | 11 | 2020-05-31T19:38:47.000Z | 2021-10-02T10:14:33.000Z | libs/baseclass/dialog_change_theme.py | biplobsd/proxySpeedTestApp | b436fa48da923ce0908f853406ca27d207a0d679 | [
"MIT"
] | null | null | null | libs/baseclass/dialog_change_theme.py | biplobsd/proxySpeedTestApp | b436fa48da923ce0908f853406ca27d207a0d679 | [
"MIT"
] | 7 | 2020-06-23T18:01:24.000Z | 2021-05-29T17:40:54.000Z | from os import environ
from os.path import join
from re import findall, sub
from datetime import datetime
from hurry.filesize import size
from kivy.metrics import sp
from kivymd.uix.button import MDIconButton
from libs.baseclass.database import MyDb
from libs.baseclass.utils import agoConv
from kivy.base import EventLo... | 33.843137 | 96 | 0.60336 |
9f8755c807a476a2bccecd9a72a8881a2ed57ccd | 193 | py | Python | services/config/settings.py | OpenKnowledgeMaps/headstart-ifs | 95c3e7f7384d66c5b13d02ac26a00b30fbed3cb1 | [
"MIT"
] | 4 | 2019-06-26T16:23:06.000Z | 2021-09-19T01:03:47.000Z | services/config/settings.py | OpenKnowledgeMaps/headstart-ifs | 95c3e7f7384d66c5b13d02ac26a00b30fbed3cb1 | [
"MIT"
] | null | null | null | services/config/settings.py | OpenKnowledgeMaps/headstart-ifs | 95c3e7f7384d66c5b13d02ac26a00b30fbed3cb1 | [
"MIT"
] | 2 | 2018-12-04T13:55:51.000Z | 2019-06-26T16:23:09.000Z | SECRET_KEY = "TEST TEST SECRETKEY"
WTF_CSRF_SECRET_KEY = "A SECRETKEY FOR CSRF"
CASSANDRA_HOSTS = ['192.168.1.1', '192.168.1.2', '127.0.0.1']
REDIS_URL = "redis://:password@localhost:6379/0"
| 27.571429 | 61 | 0.704663 |
d9dcfacbc2252de5dc8d20b793d877f2e153d7a3 | 596 | py | Python | src/untest/utils.py | tkf/untest | 4fad21af188f3a5fb27bd0525f8b5e164040a93c | [
"MIT"
] | null | null | null | src/untest/utils.py | tkf/untest | 4fad21af188f3a5fb27bd0525f8b5e164040a93c | [
"MIT"
] | null | null | null | src/untest/utils.py | tkf/untest | 4fad21af188f3a5fb27bd0525f8b5e164040a93c | [
"MIT"
] | null | null | null | import signal
from contextlib import contextmanager
@contextmanager
def ignoring(sig):
"""
Context manager for ignoring signal `sig`.
For example,::
with ignoring(signal.SIGINT):
do_something()
would ignore user's ctrl-c during ``do_something()``. This is
useful when launch... | 21.285714 | 67 | 0.645973 |
e83a854de672b2fd431b71183d1d30873c9e0b23 | 3,832 | py | Python | examples/red-pitaya/fft/python/adc_calibration.py | labolas89/koheron-sdk | c7cff24a6f437f3288ab404536c9d5c5481a6733 | [
"MIT"
] | 1 | 2021-04-19T09:09:47.000Z | 2021-04-19T09:09:47.000Z | examples/red-pitaya/fft/python/adc_calibration.py | rsarwar87/koheron-sdk | 02c35bf3c1c29f1029fad18b881dbd193efac5a7 | [
"MIT"
] | null | null | null | examples/red-pitaya/fft/python/adc_calibration.py | rsarwar87/koheron-sdk | 02c35bf3c1c29f1029fad18b881dbd193efac5a7 | [
"MIT"
] | null | null | null | import visa
import os
import numpy as np
import time
import matplotlib.pyplot as plt
from scipy import stats
from fft import FFT, Window
from koheron import connect
# Both the Koheron Alpha and the Keysight 33600A must be
# disciplined on the Tektronix MCA3027 OCXO 10 MHz output.
class Keysight33600A:
def __init... | 31.669421 | 104 | 0.64405 |
00e1248b8b76c9c772108b1724585746e2141359 | 613 | py | Python | aydin/it/transforms/demo/demo_fixed_pattern_real.py | royerloic/aydin | f9c61a24030891d008c318b250da5faec69fcd7d | [
"BSD-3-Clause"
] | null | null | null | aydin/it/transforms/demo/demo_fixed_pattern_real.py | royerloic/aydin | f9c61a24030891d008c318b250da5faec69fcd7d | [
"BSD-3-Clause"
] | null | null | null | aydin/it/transforms/demo/demo_fixed_pattern_real.py | royerloic/aydin | f9c61a24030891d008c318b250da5faec69fcd7d | [
"BSD-3-Clause"
] | null | null | null | from aydin.io.datasets import examples_single
from aydin.it.transforms.fixedpattern import FixedPatternTransform
from aydin.util.log.log import Log
def demo_fixed_pattern_real():
Log.override_test_exclusion = True
image = examples_single.huang_fixed_pattern_noise.get_array() # [:, 0:64, 0:64]
bs = Fixe... | 25.541667 | 84 | 0.727569 |
df790cc107f92cad503737cba7d67eec64f12c37 | 11,477 | py | Python | Core/Python/start_inventory_job.py | swathikiran449/OpenManage-Enterprise | 2661744245e1264f9363a915ab4d5dc8989a9897 | [
"Apache-2.0"
] | null | null | null | Core/Python/start_inventory_job.py | swathikiran449/OpenManage-Enterprise | 2661744245e1264f9363a915ab4d5dc8989a9897 | [
"Apache-2.0"
] | null | null | null | Core/Python/start_inventory_job.py | swathikiran449/OpenManage-Enterprise | 2661744245e1264f9363a915ab4d5dc8989a9897 | [
"Apache-2.0"
] | null | null | null | #
# Python script using OME API to get device list.
#
# _author_ = Prasad Rao <prasad_rao1@Dell.com>
# _version_ = 0.1
#
#
# Copyright (c) 2020 Dell EMC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a ... | 44.832031 | 140 | 0.612878 |
6857eba521bdd247b97ebe4800d9cf470e8affbe | 516 | py | Python | main.py | Dasajev/recipescrapers | 5e11949fee0c3ea3d0cf130a0cb77af90c302cb9 | [
"MIT"
] | null | null | null | main.py | Dasajev/recipescrapers | 5e11949fee0c3ea3d0cf130a0cb77af90c302cb9 | [
"MIT"
] | null | null | null | main.py | Dasajev/recipescrapers | 5e11949fee0c3ea3d0cf130a0cb77af90c302cb9 | [
"MIT"
] | null | null | null | import k_ruoka
import pioneerwoman
import kotikokki
import budgetbytes
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Downloads recipes as JSON.')
parser.add_argument("url")
args = parser.parse_args()
url = args.url
if "pioneerwoman.com" in url:
print (pioneerwoman.s... | 24.571429 | 75 | 0.746124 |
8ca58dd56c4438ddc8db2db4d75f165ddd23a8ed | 1,184 | py | Python | src/sentry/__init__.py | NickPresta/sentry | ed3e6034ef560e18f392ba30071de860557b7b43 | [
"BSD-3-Clause"
] | 2 | 2015-10-14T12:45:32.000Z | 2016-01-27T03:24:43.000Z | src/sentry/__init__.py | NickPresta/sentry | ed3e6034ef560e18f392ba30071de860557b7b43 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/__init__.py | NickPresta/sentry | ed3e6034ef560e18f392ba30071de860557b7b43 | [
"BSD-3-Clause"
] | null | null | null | """
sentry
~~~~~~
:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import os
import os.path
try:
VERSION = __import__('pkg_resources') \
.get_distribution('sentry').version
except Exception, e:
VERSION = 'unknown'
def _get_g... | 23.68 | 84 | 0.650338 |
73aaca52a06410e70de863afd075cbfd669cfb36 | 3,486 | py | Python | core/polyaxon/polyflow/matrix/__init__.py | Ohtar10/polyaxon | 1e41804e4ae6466b6928d06bc6ee6d2d9c7b8931 | [
"Apache-2.0"
] | null | null | null | core/polyaxon/polyflow/matrix/__init__.py | Ohtar10/polyaxon | 1e41804e4ae6466b6928d06bc6ee6d2d9c7b8931 | [
"Apache-2.0"
] | null | null | null | core/polyaxon/polyflow/matrix/__init__.py | Ohtar10/polyaxon | 1e41804e4ae6466b6928d06bc6ee6d2d9c7b8931 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 28.112903 | 85 | 0.741824 |
ab090b41732c7395a0266ebae03e21a6f49bbb5e | 2,402 | py | Python | second-analysis-steps/code/building-decays/02.optimized.py | marianstahl/starterkit-lessons | 0b435c197a7629dc7046e6440647925c4d3ed808 | [
"CC-BY-4.0"
] | 21 | 2017-05-08T20:32:34.000Z | 2021-11-15T13:10:20.000Z | second-analysis-steps/code/building-decays/02.optimized.py | marianstahl/starterkit-lessons | 0b435c197a7629dc7046e6440647925c4d3ed808 | [
"CC-BY-4.0"
] | 212 | 2017-05-08T14:26:38.000Z | 2022-02-22T15:23:50.000Z | second-analysis-steps/code/building-decays/02.optimized.py | marianstahl/starterkit-lessons | 0b435c197a7629dc7046e6440647925c4d3ed808 | [
"CC-BY-4.0"
] | 82 | 2017-05-08T13:46:14.000Z | 2021-12-08T15:59:32.000Z | from Configurables import DaVinci
from GaudiConf import IOHelper
# Load algorithms
from Configurables import CombineParticles
from Configurables import DaVinci
from Configurables import DecayTreeTuple
from DecayTreeTuple.Configuration import *
# Load input particles
from StandardParticles import StdAllNoPIDsPions as ... | 29.292683 | 148 | 0.704829 |
1191780508c334c3bb8122103ed76bade7ba459b | 2,362 | py | Python | config_app/config_util/config/TransientDirectoryProvider.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | null | null | null | config_app/config_util/config/TransientDirectoryProvider.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | null | null | null | config_app/config_util/config/TransientDirectoryProvider.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | null | null | null | import os
from shutil import copytree
from backports.tempfile import TemporaryDirectory
from config_app.config_util.config.fileprovider import FileConfigProvider
OLD_CONFIG_SUBDIR = "old/"
class TransientDirectoryProvider(FileConfigProvider):
""" Implementation of the config provider that reads and writes the ... | 36.90625 | 99 | 0.709568 |
93a2cf0b059e4b6b0df39c6ad306a250ae5694cc | 642 | py | Python | manabi/apps/flashcards/migrations/0024_deactivate_cards_in_inactive_decks.py | aehlke/manabi | 1dfdd4ecb9c1214b6a70268be0dcfeda9da8754b | [
"MIT"
] | 14 | 2015-10-03T07:34:28.000Z | 2021-09-20T07:10:29.000Z | manabi/apps/flashcards/migrations/0024_deactivate_cards_in_inactive_decks.py | aehlke/manabi | 1dfdd4ecb9c1214b6a70268be0dcfeda9da8754b | [
"MIT"
] | 23 | 2019-10-25T08:47:23.000Z | 2022-01-30T02:00:45.000Z | manabi/apps/flashcards/migrations/0024_deactivate_cards_in_inactive_decks.py | aehlke/manabi | 1dfdd4ecb9c1214b6a70268be0dcfeda9da8754b | [
"MIT"
] | 7 | 2016-10-04T08:10:36.000Z | 2021-09-20T07:10:33.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-29 23:34
from django.db import migrations
def forwards(apps, schema_editor):
Deck = apps.get_model('flashcards', 'Deck')
for deck in Deck.objects.filter(active=False).order_by('id').iterator():
print("Deactivating deck", deck.id)
... | 23.777778 | 76 | 0.658879 |
271ad8c322284a3220eed23f2422320f629e1e9d | 12,893 | py | Python | tutorials/image/cifar10/cifar10.py | baranshad/models | aaf008855e9764f32d974e86f8e1f9cfddfafd9a | [
"Apache-2.0"
] | 3 | 2019-10-03T21:19:45.000Z | 2019-10-04T00:29:59.000Z | tutorials/image/cifar10/cifar10.py | baranshad/models | aaf008855e9764f32d974e86f8e1f9cfddfafd9a | [
"Apache-2.0"
] | 1 | 2020-02-11T16:24:53.000Z | 2020-02-11T16:24:53.000Z | tutorials/image/cifar10/cifar10.py | baranshad/models | aaf008855e9764f32d974e86f8e1f9cfddfafd9a | [
"Apache-2.0"
] | 3 | 2020-01-21T00:18:08.000Z | 2020-01-27T05:40:41.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... | 36.420904 | 81 | 0.688125 |
9ab5dc04e72ad66a676649162794c20a97a9d336 | 8,704 | py | Python | Checker.py | Mouradost/ASTIR | 2a9a772e86ec2cb6df155dace49c7b2dca24d67e | [
"MIT"
] | 4 | 2020-05-21T13:35:42.000Z | 2022-02-17T18:37:29.000Z | Checker.py | Mouradost/ASTIR | 2a9a772e86ec2cb6df155dace49c7b2dca24d67e | [
"MIT"
] | null | null | null | Checker.py | Mouradost/ASTIR | 2a9a772e86ec2cb6df155dace49c7b2dca24d67e | [
"MIT"
] | 1 | 2021-11-22T13:21:26.000Z | 2021-11-22T13:21:26.000Z | from Networks import Trainer, DeepST_Base_Line, ConvLSTM, ConvLSTM_Base_Line, ConvLSTM_ResNet, ConvLSTM_Inception_ResNet
import Preprocessing
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import os
def info_visualisation(DB_name, Net_name, nb_modules, filters, activation, save_path=''):
if... | 60.867133 | 282 | 0.563189 |
a65b77d89b7374a4acf50fae2be2e6274b6c6913 | 13,261 | py | Python | tensor2tensor/layers/transformer_glow_layers_test.py | Lee6903/tensor2tensor | c22a226704e5887862bf9edd9f269892c9016ad4 | [
"Apache-2.0"
] | 12,921 | 2017-06-15T17:11:46.000Z | 2022-03-31T15:22:11.000Z | tensor2tensor/layers/transformer_glow_layers_test.py | Lee6903/tensor2tensor | c22a226704e5887862bf9edd9f269892c9016ad4 | [
"Apache-2.0"
] | 1,635 | 2017-06-18T15:29:27.000Z | 2022-03-19T20:35:23.000Z | tensor2tensor/layers/transformer_glow_layers_test.py | Lee6903/tensor2tensor | c22a226704e5887862bf9edd9f269892c9016ad4 | [
"Apache-2.0"
] | 3,521 | 2017-06-15T18:25:42.000Z | 2022-03-31T05:47:55.000Z | # coding=utf-8
# Copyright 2021 The Tensor2Tensor 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... | 39.703593 | 79 | 0.677928 |
ab02382bfe5ecbf6be2485d3ecc99cf612382fa7 | 1,548 | py | Python | db/DAOString.py | normalPasserby/prac | 6026c916fdbc9a8abbf4cedfd829600b9192736e | [
"MIT"
] | null | null | null | db/DAOString.py | normalPasserby/prac | 6026c916fdbc9a8abbf4cedfd829600b9192736e | [
"MIT"
] | null | null | null | db/DAOString.py | normalPasserby/prac | 6026c916fdbc9a8abbf4cedfd829600b9192736e | [
"MIT"
] | null | null | null | CREATE_STOCK = '''CREATE TABLE STOCK
(STOCK_ID INTEGER PRIMARY KEY NOT NULL,
STOCK_NAME TEXT NOT NULL,
RECENT_YEAR INTEGER );'''
CREATE_REP = '''CREATE TABLE report
(REP_NAME TEXT PRIMARY KEY NOT NULL,
STOCK_ID INTEGER NOT ... | 36.857143 | 78 | 0.621447 |
13806512d79352cf10eedefe58a2b6eccfe65a60 | 2,439 | py | Python | lapis/monitor/cobald.py | tfesenbecker/lapis | 0a79525ad0c3418893232fb084d9437b625696a5 | [
"MIT"
] | null | null | null | lapis/monitor/cobald.py | tfesenbecker/lapis | 0a79525ad0c3418893232fb084d9437b625696a5 | [
"MIT"
] | 13 | 2020-09-17T14:17:14.000Z | 2020-10-14T14:30:58.000Z | lapis/monitor/cobald.py | tfesenbecker/lapis | 0a79525ad0c3418893232fb084d9437b625696a5 | [
"MIT"
] | null | null | null | import logging
from cobald.monitor.format_json import JsonFormatter
from cobald.monitor.format_line import LineProtocolFormatter
from typing import List, Dict
from lapis.drone import Drone
from lapis.monitor import LoggingSocketHandler, LoggingUDPSocketHandler
from lapis.pool import Pool
def drone_statistics(drone:... | 30.111111 | 83 | 0.657237 |
cf16e029a322a7d5ca40dc525700175bbfcfac6d | 43,136 | py | Python | rundeck/api.py | otupman/rundeckrun | ca78bc7e9fb1becf940c949e20b820af89f9cecc | [
"Apache-2.0"
] | 49 | 2015-01-21T10:07:16.000Z | 2021-11-15T11:43:19.000Z | rundeck/api.py | otupman/rundeckrun | ca78bc7e9fb1becf940c949e20b820af89f9cecc | [
"Apache-2.0"
] | 19 | 2015-01-21T10:18:42.000Z | 2019-10-04T03:32:32.000Z | rundeck/api.py | otupman/rundeckrun | ca78bc7e9fb1becf940c949e20b820af89f9cecc | [
"Apache-2.0"
] | 32 | 2015-09-09T04:58:39.000Z | 2022-03-17T10:10:25.000Z | """
:summary: Direct interaction with Rundeck server API
:license: Apache License, Version 2.0
:author: Mark LaPerriere
:contact: rundeckrun@mindmind.com
:copyright: Mark LaPerriere 2015
"""
__docformat__ = "restructuredtext en"
from functools import partial
from xml.sax.saxutils import quoteattr
try:
from urllib... | 37.607672 | 148 | 0.570452 |
5782b919191beb88a116be49b3a32339689ebe26 | 5,809 | py | Python | pokepy/views.py | locolan/pokepy | bc77a4ef338b5575ae0e8245c0fb205016c6c11b | [
"MIT"
] | null | null | null | pokepy/views.py | locolan/pokepy | bc77a4ef338b5575ae0e8245c0fb205016c6c11b | [
"MIT"
] | null | null | null | pokepy/views.py | locolan/pokepy | bc77a4ef338b5575ae0e8245c0fb205016c6c11b | [
"MIT"
] | null | null | null | from django.http import HttpResponse,HttpResponseRedirect
from django.template import RequestContext, loader
from django.shortcuts import render
from django.conf import settings
from django.db import models
from django import forms
from pokepy.forms import SearchForm
from importlib import import_module
import pykemon,s... | 29.789744 | 116 | 0.490962 |
8c98b0e03e35affed7af5b9a5d484cc5f60661a2 | 2,102 | py | Python | saleor/graphql/extensions/types.py | fooliscool/saleor | 9502467c0e745eb8afdbfa373d634814d133e864 | [
"CC-BY-4.0"
] | 19 | 2019-12-03T17:28:07.000Z | 2021-09-10T21:30:52.000Z | saleor/graphql/extensions/types.py | fooliscool/saleor | 9502467c0e745eb8afdbfa373d634814d133e864 | [
"CC-BY-4.0"
] | 51 | 2019-12-06T08:06:07.000Z | 2021-05-06T02:10:50.000Z | saleor/graphql/extensions/types.py | jnbao2020/saleor | e1773b42a8ecd78114cf4485d553b09469b5f1f8 | [
"CC-BY-4.0"
] | 20 | 2020-02-03T00:38:59.000Z | 2022-01-03T13:07:52.000Z | import graphene
from ...extensions import ConfigurationTypeField, manager, models
from ..core.connection import CountableDjangoObjectType
from .enums import ConfigurationTypeFieldEnum
def hide_private_configuration_fields(configuration, config_structure):
for field in configuration:
name = field["name"]
... | 38.925926 | 87 | 0.688868 |
9d457b72bf23bc90982a39790d8a91ecf6664b5b | 2,392 | py | Python | 15. Workshop - Lab 2/game.py | elenaborisova/Python-Advanced | 4c266d81f294372c3599741e8ba53f59fdc834c5 | [
"MIT"
] | 2 | 2021-04-04T06:26:13.000Z | 2022-02-18T22:21:49.000Z | 15. Workshop - Lab 2/game.py | elenaborisova/Python-Advanced | 4c266d81f294372c3599741e8ba53f59fdc834c5 | [
"MIT"
] | null | null | null | 15. Workshop - Lab 2/game.py | elenaborisova/Python-Advanced | 4c266d81f294372c3599741e8ba53f59fdc834c5 | [
"MIT"
] | 3 | 2021-02-01T12:32:03.000Z | 2021-04-12T13:45:20.000Z | import random
class Game:
def __init__(self):
self.width = 800
self.height = 600
self.__ball_pos = (0, 0)
self.__ball_delta_x = 1
self.__ball_delta_y = 1
self.paddle_a_pos = (-self.width / 2 + 50, 0)
self.paddle_b_pos = (self.width / 2 - 50, 0)
sel... | 29.530864 | 129 | 0.545569 |
508c68d7bd8c5bd3a0bbc98b95ccb21d1c030dc5 | 2,323 | py | Python | projeto/main/game/pieces/pawn.py | neilom18/g5-chess | 8998199b3432f0b83aa27e5c2126173ecc87f311 | [
"MIT"
] | null | null | null | projeto/main/game/pieces/pawn.py | neilom18/g5-chess | 8998199b3432f0b83aa27e5c2126173ecc87f311 | [
"MIT"
] | 1 | 2021-10-03T22:26:45.000Z | 2021-10-03T22:26:45.000Z | projeto/main/game/pieces/pawn.py | neilom18/g5-chess | 8998199b3432f0b83aa27e5c2126173ecc87f311 | [
"MIT"
] | null | null | null | #Peão está funcional teoricamente e praticamente
# esse start é simualdo não utilizar ele no oficial (possui peças deslocadas)
def Pawn(allPieces,piece):
if piece[0] == 'p':
possibleMoves = []
color = piece[1]
col = int(piece[2]) # y
row = int(piece[3]) # x
if color == '... | 36.873016 | 77 | 0.436505 |
7fa65605f373bb773e7700052c14cdd58e55214a | 929 | py | Python | Python/eight_kyu/abbrev_name.py | Brokenshire/codewars-projects | db9cd09618b8a7085b0d53ad76f73f9e249b9396 | [
"Apache-2.0"
] | 1 | 2019-12-20T04:09:56.000Z | 2019-12-20T04:09:56.000Z | Python/eight_kyu/abbrev_name.py | Brokenshire/codewars-projects | db9cd09618b8a7085b0d53ad76f73f9e249b9396 | [
"Apache-2.0"
] | null | null | null | Python/eight_kyu/abbrev_name.py | Brokenshire/codewars-projects | db9cd09618b8a7085b0d53ad76f73f9e249b9396 | [
"Apache-2.0"
] | null | null | null | # Python solution for 'Abbreviate a Two Word Name' codewars question.
# Level: 8 kyu
# Tags: FUNDAMENTALS, STRINGS, and ARRAYS.
# Author: Jack Brokenshire
# Date: 16/05/2020
import unittest
def abbrev_name(name):
"""
Converts name of two words into initials.
:param name: a string.
:return: two capita... | 28.151515 | 69 | 0.658773 |
fe98e83481b1a0f17097862e4fc068b282890aa8 | 1,404 | py | Python | karp/services/context.py | spraakbanken/karp-backend-v6-tmp | e5b78157bd999df18c188973ae2a337015b6f35d | [
"MIT"
] | 1 | 2021-12-08T15:33:42.000Z | 2021-12-08T15:33:42.000Z | karp/services/context.py | spraakbanken/karp-backend-v6-tmp | e5b78157bd999df18c188973ae2a337015b6f35d | [
"MIT"
] | null | null | null | karp/services/context.py | spraakbanken/karp-backend-v6-tmp | e5b78157bd999df18c188973ae2a337015b6f35d | [
"MIT"
] | null | null | null | from typing import Dict
# from functools import singledispatch
# from karp.application.config import Config
from karp.domain import repository, index # ResourceRepository
from .auth_service import AuthService
# from karp.domain.services.auth.auth import Auth
# from karp.domain.models.search_service import SearchSer... | 30.521739 | 63 | 0.719373 |
a691e2d47fcd92ac67a6b2a76d5b9f1c19b35a90 | 1,557 | py | Python | Menel/objects/message.py | 05xapresses/Menel | 7b79cdb51e613d8b4b1bdaa972338381c2936fa7 | [
"MIT"
] | null | null | null | Menel/objects/message.py | 05xapresses/Menel | 7b79cdb51e613d8b4b1bdaa972338381c2936fa7 | [
"MIT"
] | null | null | null | Menel/objects/message.py | 05xapresses/Menel | 7b79cdb51e613d8b4b1bdaa972338381c2936fa7 | [
"MIT"
] | null | null | null | from typing import Optional
import discord
from ..objects.bot import bot
class Message(discord.Message):
def __init__(self, message: discord.Message):
self.message = message
self.bot = bot
def __getattr__(self, item):
return self.message.__getattribute__(item)
async def send(... | 33.847826 | 116 | 0.667309 |
21292a213370a3c1dbc1dd81b6342e5431239bd4 | 2,689 | py | Python | tests/test_cli.py | rockstack/rock | 1d010d942c5b1c8fd198223ac1f4a3dd5d690edb | [
"MIT"
] | 1 | 2015-03-13T06:01:06.000Z | 2015-03-13T06:01:06.000Z | tests/test_cli.py | rockstack/rock | 1d010d942c5b1c8fd198223ac1f4a3dd5d690edb | [
"MIT"
] | null | null | null | tests/test_cli.py | rockstack/rock | 1d010d942c5b1c8fd198223ac1f4a3dd5d690edb | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import helper
import os
import subprocess
import sys
import tempfile
try:
from io import StringIO
except ImportError:
from StringIO import StringIO
from rock import cli, utils
from rock.exceptions import ConfigError
from rock.project import Project
from helper import Arg... | 29.877778 | 109 | 0.618074 |
cf3dcb4c852d1b9a4a8e6937f3394f021324048e | 8,609 | py | Python | pysnmp/APSYSLOG-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/APSYSLOG-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/APSYSLOG-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module APSYSLOG-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/APSYSLOG-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:08:36 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019,... | 122.985714 | 1,249 | 0.759786 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.