hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c307c01322f202fd16db183f5cc4916c31fb584e | 12,205 | py | Python | holoviews/plotting/bokeh/annotation.py | cocoaaa/holoviews | bb3dc4975c2604f38d141ccad1c931ed5d9b1322 | [
"BSD-3-Clause"
] | null | null | null | holoviews/plotting/bokeh/annotation.py | cocoaaa/holoviews | bb3dc4975c2604f38d141ccad1c931ed5d9b1322 | [
"BSD-3-Clause"
] | null | null | null | holoviews/plotting/bokeh/annotation.py | cocoaaa/holoviews | bb3dc4975c2604f38d141ccad1c931ed5d9b1322 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division, unicode_literals
from collections import defaultdict
import param
import numpy as np
from bokeh.models import Span, Arrow, Div as BkDiv
try:
from bokeh.models.arrow_heads import TeeHead, NormalHead
arrow_start = {'<->': NormalHead, '<|-|>': NormalHead}
arr... | 37.210366 | 91 | 0.599754 |
f01ebb21b59e2cb82f71dd187737dc49d06cf708 | 41,038 | py | Python | setup.py | hubert-pietron/airflow | 3f9073c46940ef1f25a9f46b447d9cf84435c3ed | [
"Apache-2.0"
] | 8,092 | 2016-04-27T20:32:29.000Z | 2019-01-05T07:39:33.000Z | setup.py | hubert-pietron/airflow | 3f9073c46940ef1f25a9f46b447d9cf84435c3ed | [
"Apache-2.0"
] | 2,961 | 2016-05-05T07:16:16.000Z | 2019-01-05T08:47:59.000Z | setup.py | hubert-pietron/airflow | 3f9073c46940ef1f25a9f46b447d9cf84435c3ed | [
"Apache-2.0"
] | 3,546 | 2016-05-04T20:33:16.000Z | 2019-01-05T05:14:26.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... | 34.572873 | 110 | 0.669428 |
024796d43fb3318444b50d74f16942094bda2f6c | 235 | py | Python | src/fractal/world/fractum/placement/placement/analysis.py | jedhsu/fractal | 97833ddc5063fae72352cf590738fef508c02f0c | [
"MIT"
] | null | null | null | src/fractal/world/fractum/placement/placement/analysis.py | jedhsu/fractal | 97833ddc5063fae72352cf590738fef508c02f0c | [
"MIT"
] | null | null | null | src/fractal/world/fractum/placement/placement/analysis.py | jedhsu/fractal | 97833ddc5063fae72352cf590738fef508c02f0c | [
"MIT"
] | null | null | null | from dataclasses import dataclass
@dataclass
class PlacementAnalysis(Placement):
prior_probability: float # Prior probability as given by the orac
energy: float # Cumulated Q-value for the action (Q = W/N)
excites: int
| 26.111111 | 70 | 0.744681 |
93c15870bd3d644ee75092f5a428bdda4835f206 | 462 | py | Python | Day 7/day_7.py | loveyourpassion/comm | 8295a72557d928ccb9a9d37fad73692ea82f3035 | [
"MIT"
] | 149 | 2020-03-18T17:46:09.000Z | 2022-03-17T09:30:18.000Z | Day 7/day_7.py | loveyourpassion/comm | 8295a72557d928ccb9a9d37fad73692ea82f3035 | [
"MIT"
] | 2 | 2020-10-15T17:17:13.000Z | 2021-04-30T10:34:52.000Z | Day 7/day_7.py | loveyourpassion/comm | 8295a72557d928ccb9a9d37fad73692ea82f3035 | [
"MIT"
] | 90 | 2020-03-23T19:06:01.000Z | 2022-03-10T11:08:04.000Z | class Animal():
name = 'Amy'
noise = "Grunt"
size = "Large"
color = "Brown"
hair = 'Covers body'
def get_color(self):
return self.color
def make_noise(self):
return self.noise
dog = Animal()
dog.make_noise()
dog.size = "small"
dog.color = "black"
dog.hair = "hairless"
cla... | 14.903226 | 25 | 0.571429 |
37a69527dd77246a5e343319211c833e9987164b | 8,708 | py | Python | main.py | JibbyJames/coursera-data-scraper | 7b012576795e7724b2495ac51f3eb15dfbbdaae1 | [
"Apache-2.0"
] | null | null | null | main.py | JibbyJames/coursera-data-scraper | 7b012576795e7724b2495ac51f3eb15dfbbdaae1 | [
"Apache-2.0"
] | null | null | null | main.py | JibbyJames/coursera-data-scraper | 7b012576795e7724b2495ac51f3eb15dfbbdaae1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import json
import time
import urllib.request
import pandas as pd
import numpy as np
import seaborn as sns
from matplotlib import pyplot as plt
def expand_list(df, list_column, new_column):
lens_of_lists = df[list_column].apply(len)
origin_rows = range(df.shape[0])
destination_row... | 39.944954 | 184 | 0.639757 |
d09da574941d23c9c605c085d32feed9a0aeff78 | 1,545 | py | Python | src/compas_fab/utilities/filesystem.py | Kathrin3010/compas_fab | 18230b70479ab57635b24832762c340e41102c10 | [
"MIT"
] | 1 | 2019-08-15T17:34:43.000Z | 2019-08-15T17:34:43.000Z | src/compas_fab/utilities/filesystem.py | Kathrin3010/compas_fab | 18230b70479ab57635b24832762c340e41102c10 | [
"MIT"
] | 3 | 2019-07-30T13:50:51.000Z | 2019-07-30T14:27:27.000Z | src/compas_fab/utilities/filesystem.py | yijiangh/compas_fab | d4e8e630d4daeb8981200456f2ef6b6a09ac88a8 | [
"MIT"
] | null | null | null | import os
__all__ = [
'list_files_in_directory'
]
def list_files_in_directory(directory, fullpath=False, extensions=[]):
"""This function lists just the files in a directory, not sub-directories.
Args:
directory (str): the directory to search for files.
fullpath (:obj:`bool`, optional): ... | 34.333333 | 95 | 0.598058 |
def68f6235f4a2b14d62ec0cc6cca1c36cde911a | 13,973 | py | Python | highway_env/road/road.py | ma-rapp/highway-env | d5ce0c38a615b9e5a111bcaf7183045265cbd190 | [
"MIT"
] | 1 | 2021-07-05T09:14:39.000Z | 2021-07-05T09:14:39.000Z | highway_env/road/road.py | Derekabc/highway-env | f26387926be88cf1f9e2e99a9ab99439687d0fd8 | [
"MIT"
] | null | null | null | highway_env/road/road.py | Derekabc/highway-env | f26387926be88cf1f9e2e99a9ab99439687d0fd8 | [
"MIT"
] | 1 | 2020-11-03T01:10:54.000Z | 2020-11-03T01:10:54.000Z | import numpy as np
import pandas as pd
import logging
from typing import List, Tuple, Dict, TYPE_CHECKING, Optional
from highway_env.road.lane import LineType, StraightLane, AbstractLane
from highway_env.road.objects import Landmark
if TYPE_CHECKING:
from highway_env.vehicle import kinematics
from highway_env... | 43.39441 | 120 | 0.600945 |
2be9b52c7ac0476096392703b38a249caa45d610 | 61 | py | Python | src/ralph/lib/table/__init__.py | angry-tony/cmdb-ralph | eb2ad2212a133025b698eb48e379c0bfe14cace0 | [
"Apache-2.0"
] | null | null | null | src/ralph/lib/table/__init__.py | angry-tony/cmdb-ralph | eb2ad2212a133025b698eb48e379c0bfe14cace0 | [
"Apache-2.0"
] | null | null | null | src/ralph/lib/table/__init__.py | angry-tony/cmdb-ralph | eb2ad2212a133025b698eb48e379c0bfe14cace0 | [
"Apache-2.0"
] | null | null | null | from ralph.lib.table.table import Table
__all__ = ['Table']
| 15.25 | 39 | 0.737705 |
82ec43434d3779f29f8f0596258d56a540a6011d | 2,512 | py | Python | Libraries/Python/CommonEnvironment/v1.0/CommonEnvironment/TypeInfo/FundamentalTypes/Serialization/UnitTests/JsonLikeSerialization_UnitTest.py | davidbrownell/Common_Environment | 4015872aeac8d5da30a6aa7940e1035a6aa6a75d | [
"BSL-1.0"
] | 1 | 2017-04-25T13:15:10.000Z | 2017-04-25T13:15:10.000Z | Libraries/Python/CommonEnvironment/v1.0/CommonEnvironment/TypeInfo/FundamentalTypes/Serialization/UnitTests/JsonLikeSerialization_UnitTest.py | davidbrownell/Common_Environment | 4015872aeac8d5da30a6aa7940e1035a6aa6a75d | [
"BSL-1.0"
] | null | null | null | Libraries/Python/CommonEnvironment/v1.0/CommonEnvironment/TypeInfo/FundamentalTypes/Serialization/UnitTests/JsonLikeSerialization_UnitTest.py | davidbrownell/Common_Environment | 4015872aeac8d5da30a6aa7940e1035a6aa6a75d | [
"BSL-1.0"
] | null | null | null | # ----------------------------------------------------------------------
# |
# | JsonLikeSerialization_UnitTest.py
# |
# | David Brownell <db@DavidBrownell.com>
# | 2016-09-06 17:31:15
# |
# ----------------------------------------------------------------------
# |
# | Copyright David Brownell ... | 44.857143 | 133 | 0.52508 |
0d8219d2d4ddf5daacb13d3536d21eb28b1bae58 | 12,928 | py | Python | SARSA_Agent.py | GrayKS3248/RL_Agents | dc84321b18131b811f39bc5491f4714e3554d610 | [
"MIT"
] | null | null | null | SARSA_Agent.py | GrayKS3248/RL_Agents | dc84321b18131b811f39bc5491f4714e3554d610 | [
"MIT"
] | null | null | null | SARSA_Agent.py | GrayKS3248/RL_Agents | dc84321b18131b811f39bc5491f4714e3554d610 | [
"MIT"
] | null | null | null | """
Created on Tuesday Sep 15 10:56:33 CST 2020
@author: Grayson Schaer
"""
import numpy as np
import random
class SARSA_Agent():
# Agent constructor
# @param n_s - integer size of the state space
# @param n_a - integer size of the action space
# @param n_rows - Size of the state space in the x ... | 41.569132 | 124 | 0.578125 |
a5e7dd2e876c6c04295a7a2a406f14c0bea3f9c2 | 3,568 | py | Python | installSynApps/view_model/new_config_screen.py | NSLS-II/installSynApps | 0f8e978939715bbba1a064ead3044fa36215cb09 | [
"BSD-3-Clause"
] | 3 | 2019-10-16T20:57:31.000Z | 2019-10-24T15:30:01.000Z | installSynApps/view_model/new_config_screen.py | jwlodek/installSynApps | d1fe1703cdee71be9ee34f62c85ee527d1f9ebcc | [
"BSD-3-Clause"
] | 62 | 2019-02-02T22:51:12.000Z | 2020-12-14T20:32:17.000Z | installSynApps/view_model/new_config_screen.py | epicsNSLS2-deploy/installSynApps | e39307fffb071d25031b4988285f5010e9e2bc29 | [
"BSD-3-Clause"
] | 3 | 2019-02-13T20:21:03.000Z | 2019-11-25T20:26:34.000Z | """Module containing view model for creating new configurations
"""
# Tkinter imports
import tkinter as tk
from tkinter import Button, Label, Toplevel, Frame, BooleanVar, Checkbutton
from tkinter import GROOVE, Text, END, INSERT
from tkinter import messagebox
from tkinter import filedialog
from tkinter import font as ... | 31.857143 | 147 | 0.642096 |
8f2334028f28b64dc069f820c16b5e879596c6aa | 1,118 | py | Python | aula5.py | mauriciopicirillo/Aprendendo-Python | fceb5124dc1f0446a364351358b74d37b3c99335 | [
"MIT"
] | null | null | null | aula5.py | mauriciopicirillo/Aprendendo-Python | fceb5124dc1f0446a364351358b74d37b3c99335 | [
"MIT"
] | null | null | null | aula5.py | mauriciopicirillo/Aprendendo-Python | fceb5124dc1f0446a364351358b74d37b3c99335 | [
"MIT"
] | null | null | null | lista = [12, 10, 5, 7]
lista_animal = ['cachorro', 'gato', 'elefante']
tupla = (1, 10, 12, 14)
print(len(tupla))
print(len(lista_animal))
tupla_animal = tuple(lista_animal)
print(type(tupla_animal))
print(tupla_animal)
lista_numerica = list(tupla)
print(type(lista_numerica))
lista_numerica[0] = 100
print(lista_numeric... | 19.964286 | 58 | 0.677996 |
204235a7acd1f47284d913c8d89e5e0b9784c8f2 | 8,938 | py | Python | tests/test_path.py | agos-tech/jsons | 33db6d4c4d186303ddac2a7c3b1a17dcb141e7a8 | [
"MIT"
] | null | null | null | tests/test_path.py | agos-tech/jsons | 33db6d4c4d186303ddac2a7c3b1a17dcb141e7a8 | [
"MIT"
] | null | null | null | tests/test_path.py | agos-tech/jsons | 33db6d4c4d186303ddac2a7c3b1a17dcb141e7a8 | [
"MIT"
] | null | null | null | import os.path
from pathlib import Path, PureWindowsPath, PurePosixPath
from unittest import TestCase
import jsons
class TestPath(TestCase):
def test_dump_singlepart_relative_path(self):
self.assertEqual('abc', jsons.dump(Path('abc')))
def test_dump_singlepart_pure_windows_path(self):
self.... | 32.620438 | 72 | 0.54934 |
642bef74b6b8d741cd4326ef0b9a883e114eaade | 3,159 | py | Python | backend/src/baserow/contrib/database/webhooks/models.py | LiuJun666888/baserow | bc5b7f8ebe319f90ed1aabdb7f5dfd8916c3dad1 | [
"MIT"
] | null | null | null | backend/src/baserow/contrib/database/webhooks/models.py | LiuJun666888/baserow | bc5b7f8ebe319f90ed1aabdb7f5dfd8916c3dad1 | [
"MIT"
] | null | null | null | backend/src/baserow/contrib/database/webhooks/models.py | LiuJun666888/baserow | bc5b7f8ebe319f90ed1aabdb7f5dfd8916c3dad1 | [
"MIT"
] | null | null | null | import uuid
from django.db import models
from baserow.core.models import CreatedAndUpdatedOnMixin
from baserow.contrib.database.table.models import Table
from .validators import header_name_validator, header_value_validator
class WebhookRequestMethods(models.TextChoices):
POST = "POST"
GET = "GET"
PUT ... | 32.56701 | 82 | 0.697056 |
6a35a52fcf7dcf718ba0fa780280b780d1a577b0 | 96 | py | Python | apps.py | giovanniherdigein/my_first_django | ed547cf8802951a6af17c0683a642548e025935f | [
"Unlicense"
] | null | null | null | apps.py | giovanniherdigein/my_first_django | ed547cf8802951a6af17c0683a642548e025935f | [
"Unlicense"
] | null | null | null | apps.py | giovanniherdigein/my_first_django | ed547cf8802951a6af17c0683a642548e025935f | [
"Unlicense"
] | null | null | null | from django.apps import AppConfig
class CrudsiteConfig(AppConfig):
name = 'crudsite'
| 16 | 34 | 0.71875 |
a52cf3c301bea855a7cdc839ddcd30b8d4a0a340 | 1,528 | py | Python | fastai/callbacks/rnn.py | suleepkumar/fastai | 728a7154dc120c177fe3499d2e3bf1ba389580fb | [
"Apache-2.0"
] | 1 | 2018-12-30T04:12:43.000Z | 2018-12-30T04:12:43.000Z | fastai/callbacks/rnn.py | suleepkumar/fastai | 728a7154dc120c177fe3499d2e3bf1ba389580fb | [
"Apache-2.0"
] | 2 | 2021-05-20T23:02:08.000Z | 2021-09-28T05:48:00.000Z | fastai/callbacks/rnn.py | Acidburn0zzz/fastai | 0bc9f78668455af3c0ff8894ea1b2375ec4cd91b | [
"Apache-2.0"
] | null | null | null | "Regroups lr adjustment to seq_len, AR and TAR"
from ..torch_core import *
from ..callback import *
from ..basic_train import Learner, LearnerCallback
__all__ = ['RNNTrainer']
@dataclass
class RNNTrainer(LearnerCallback):
"`Callback` that regroups lr adjustment to seq_len, AR and TAR."
bptt:int=0
alpha:fl... | 39.179487 | 98 | 0.639398 |
f2250ff3f18b334488053a4837d680aa449442ea | 5,061 | py | Python | examples/decoding/ssd_spatial_filters.py | andylikescodes/mne-python | 79ea57a4318d8d045f5966c26360b079f40a4865 | [
"BSD-3-Clause"
] | 1 | 2022-02-19T08:13:49.000Z | 2022-02-19T08:13:49.000Z | examples/decoding/ssd_spatial_filters.py | LiFeng-SECUC/mne-python | 732bb1f994e64e41a8e95dcc10dc98c22cac95c0 | [
"BSD-3-Clause"
] | null | null | null | examples/decoding/ssd_spatial_filters.py | LiFeng-SECUC/mne-python | 732bb1f994e64e41a8e95dcc10dc98c22cac95c0 | [
"BSD-3-Clause"
] | null | null | null | """
===========================================================
Compute Spectro-Spatial Decomposition (SSD) spatial filters
===========================================================
In this example, we will compute spatial filters for retaining
oscillatory brain activity and down-weighting 1/f background signals
as ... | 35.640845 | 79 | 0.662912 |
cff551e5b5c1f9558d284ea20028f6d72517a187 | 23,069 | py | Python | zerver/lib/test_helpers.py | guettli/zulip | d9431a5e66a97c619aecfe92c4a2cb4acc609431 | [
"Apache-2.0"
] | null | null | null | zerver/lib/test_helpers.py | guettli/zulip | d9431a5e66a97c619aecfe92c4a2cb4acc609431 | [
"Apache-2.0"
] | null | null | null | zerver/lib/test_helpers.py | guettli/zulip | d9431a5e66a97c619aecfe92c4a2cb4acc609431 | [
"Apache-2.0"
] | null | null | null | import collections
import os
import re
import sys
import time
from contextlib import contextmanager
from typing import (
IO,
TYPE_CHECKING,
Any,
Callable,
Dict,
Generator,
Iterable,
Iterator,
List,
Mapping,
Optional,
Tuple,
TypeVar,
Union,
cast,
)
from unittes... | 38.320598 | 146 | 0.639213 |
85b16c3336dc2ac41c92a43966b446f103d69bb2 | 4,295 | py | Python | model_zoo/dac_ctr/feature_transform.py | QiJune/elasticdl | 6b01f5b32fd757badff96ed652662bd94afe9263 | [
"MIT"
] | null | null | null | model_zoo/dac_ctr/feature_transform.py | QiJune/elasticdl | 6b01f5b32fd757badff96ed652662bd94afe9263 | [
"MIT"
] | null | null | null | model_zoo/dac_ctr/feature_transform.py | QiJune/elasticdl | 6b01f5b32fd757badff96ed652662bd94afe9263 | [
"MIT"
] | null | null | null | # Copyright 2020 The ElasticDL 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 applicable law... | 36.092437 | 79 | 0.686147 |
935cdfa4a2ac2af7ec1353c1ae48f791a06c5e99 | 2,313 | py | Python | houdini/handlers/login/__init__.py | TeegxCP/houdini | edb55ef6094500c6a20a6827a6af9525ea2b7b36 | [
"MIT"
] | 444 | 2020-05-30T22:28:53.000Z | 2022-02-13T04:27:48.000Z | houdini/handlers/login/__init__.py | TeegxCP/houdini | edb55ef6094500c6a20a6827a6af9525ea2b7b36 | [
"MIT"
] | 43 | 2020-05-18T17:40:12.000Z | 2021-11-05T02:53:46.000Z | houdini/handlers/login/__init__.py | TeegxCP/houdini | edb55ef6094500c6a20a6827a6af9525ea2b7b36 | [
"MIT"
] | 56 | 2020-05-20T16:31:18.000Z | 2022-03-07T19:49:59.000Z | from houdini import handlers
from houdini.constants import ClientType
from houdini.converters import VersionChkConverter
from houdini.data.buddy import BuddyList
from houdini.handlers import XMLPacket
@handlers.handler(XMLPacket('verChk'))
@handlers.allow_once
async def handle_version_check(p, version: VersionChkConv... | 39.87931 | 109 | 0.653696 |
89199b273ca9e9f3c60ee387520a6385f6db6c3e | 6,265 | py | Python | galpy/potential_src/FlattenedPowerPotential.py | fardal/galpy | 93a1b6fc8d138899922127086cc66184919c8cba | [
"BSD-3-Clause"
] | null | null | null | galpy/potential_src/FlattenedPowerPotential.py | fardal/galpy | 93a1b6fc8d138899922127086cc66184919c8cba | [
"BSD-3-Clause"
] | null | null | null | galpy/potential_src/FlattenedPowerPotential.py | fardal/galpy | 93a1b6fc8d138899922127086cc66184919c8cba | [
"BSD-3-Clause"
] | null | null | null | ###############################################################################
# FlattenedPowerPotential.py: Power-law potential that is flattened in the
# potential (NOT the density)
#
# amp
# phi(R,z)= --------- ; m^2 = R^2... | 31.014851 | 172 | 0.480447 |
e6866b851103bd65fe3988d9b6f2dd5bc74c5176 | 5,978 | py | Python | fkie_iop_node_manager/src/fkie_iop_node_manager/statistics/collector.py | fkie/iop_node_manager | c2e12989a6baf7098c93c33ca6e95acf7584e462 | [
"Apache-2.0"
] | 1 | 2021-05-05T14:57:06.000Z | 2021-05-05T14:57:06.000Z | fkie_iop_node_manager/src/fkie_iop_node_manager/statistics/collector.py | fkie/iop_node_manager | c2e12989a6baf7098c93c33ca6e95acf7584e462 | [
"Apache-2.0"
] | null | null | null | fkie_iop_node_manager/src/fkie_iop_node_manager/statistics/collector.py | fkie/iop_node_manager | c2e12989a6baf7098c93c33ca6e95acf7584e462 | [
"Apache-2.0"
] | null | null | null | # ****************************************************************************
#
# fkie_iop_node_manager
# Copyright 2019 Fraunhofer FKIE
# Author: Alexander Tiderko
#
# 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 ... | 34.554913 | 110 | 0.556708 |
6b9e076b3fe61f349d4021b5919bece1fe3756b4 | 12,410 | py | Python | sdks/python/client/argo_workflows/model/key_to_path.py | parallel-domain/argo-workflows | c055b48b6e216dcdeb1c9840f14199a72329bdaf | [
"Apache-2.0"
] | 1 | 2022-02-20T16:56:43.000Z | 2022-02-20T16:56:43.000Z | sdks/python/client/argo_workflows/model/key_to_path.py | parallel-domain/argo-workflows | c055b48b6e216dcdeb1c9840f14199a72329bdaf | [
"Apache-2.0"
] | 10 | 2022-02-21T04:17:37.000Z | 2022-03-11T11:34:30.000Z | sdks/python/client/argo_workflows/model/key_to_path.py | parallel-domain/argo-workflows | c055b48b6e216dcdeb1c9840f14199a72329bdaf | [
"Apache-2.0"
] | null | null | null | """
Argo Workflows API
Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/ # noqa: E501
The version of the OpenAPI document: VERSION
Generated by: https://openapi-g... | 45.625 | 310 | 0.578566 |
37d7feeccb3e6c0919f8d30e723c3af1a9445465 | 662 | py | Python | venv/lib/python3.9/site-packages/libfuturize/fixes/fix_add__future__imports_except_unicode_literals.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | 908 | 2015-01-01T21:20:45.000Z | 2022-03-29T20:47:16.000Z | venv/lib/python3.9/site-packages/libfuturize/fixes/fix_add__future__imports_except_unicode_literals.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | 402 | 2015-01-04T01:30:19.000Z | 2022-03-24T11:56:38.000Z | venv/lib/python3.9/site-packages/libfuturize/fixes/fix_add__future__imports_except_unicode_literals.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | 305 | 2015-01-18T19:29:37.000Z | 2022-03-24T09:40:09.000Z | """
Fixer for adding:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
This is "stage 1": hopefully uncontroversial changes.
Stage 2 adds ``unicode_literals``.
"""
from lib2to3 import fixer_base
from libfuturize.fixer_util import future_import
... | 24.518519 | 67 | 0.73565 |
3ec6bda85c25e2b025def7d171ba9457d0985703 | 475 | py | Python | apps/user_app/migrations/0006_auto_20161227_2017.py | lightless233/npiss | 8338f50d971600fe2b2366836ca2fb543f2276d5 | [
"MIT"
] | 1 | 2016-11-22T13:25:02.000Z | 2016-11-22T13:25:02.000Z | apps/user_app/migrations/0006_auto_20161227_2017.py | LiGhT1EsS/npiss | 8338f50d971600fe2b2366836ca2fb543f2276d5 | [
"MIT"
] | 4 | 2020-06-05T17:28:20.000Z | 2022-03-11T23:15:49.000Z | apps/user_app/migrations/0006_auto_20161227_2017.py | lightless233/npiss | 8338f50d971600fe2b2366836ca2fb543f2276d5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-27 12:17
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user_app', '0005_auto_20161227_2016'),
]
operations = [
migrations.AlterFie... | 22.619048 | 65 | 0.629474 |
5c3b1724c19e25ee420ec68a069a3bb17d0a9ee4 | 6,526 | py | Python | texar/tf/module_base.py | jiajunhua/asyml-texar | 22d7b8eea5bd43eef68b615ba87b2e8220bafdf8 | [
"Apache-2.0"
] | 1 | 2020-09-18T04:36:43.000Z | 2020-09-18T04:36:43.000Z | texar/tf/module_base.py | jiajunhua/asyml-texar | 22d7b8eea5bd43eef68b615ba87b2e8220bafdf8 | [
"Apache-2.0"
] | 6 | 2020-09-26T01:31:48.000Z | 2021-08-25T16:13:51.000Z | texar/tf/module_base.py | jiajunhua/asyml-texar | 22d7b8eea5bd43eef68b615ba87b2e8220bafdf8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Texar 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 applicable ... | 34.529101 | 80 | 0.630555 |
6c664978ad6b2474b5abc6332caee877be61fb00 | 22,466 | py | Python | lgp/models/alfred/hlsm/hlsm_subgoal_model.py | keio-smilab22/HLSM-MAT | 6f34a5ec9226b28c01ae47ef16fe28662ab32935 | [
"BSD-3-Clause"
] | null | null | null | lgp/models/alfred/hlsm/hlsm_subgoal_model.py | keio-smilab22/HLSM-MAT | 6f34a5ec9226b28c01ae47ef16fe28662ab32935 | [
"BSD-3-Clause"
] | null | null | null | lgp/models/alfred/hlsm/hlsm_subgoal_model.py | keio-smilab22/HLSM-MAT | 6f34a5ec9226b28c01ae47ef16fe28662ab32935 | [
"BSD-3-Clause"
] | null | null | null | from typing import Dict, List, Union
import torch
import torch.nn as nn
from lgp.abcd.functions.action_proposal import ActionProposal
from lgp.abcd.model import LearnableModel
import lgp.env.alfred.segmentation_definitions as segdef
from lgp.env.alfred.alfred_subgoal import AlfredSubgoal
from lgp.ops.spatial_distr ... | 46.131417 | 153 | 0.661177 |
8115d691592d91374b6ccc17b919d54bee9b6196 | 1,489 | py | Python | runtime/image_classification/models/vgg16/gpus=16_straight/stage10.py | NestLakerJasonLIN/pipedream | f50827f2e28cbdbd82a4ea686c0498272b1460d6 | [
"MIT"
] | 273 | 2019-08-31T14:12:11.000Z | 2022-03-05T13:34:25.000Z | runtime/image_classification/models/vgg16/gpus=16_straight/stage10.py | albertsh10/pipedream | cad624f79a71f44ba79099f0c38321347b13e5c2 | [
"MIT"
] | 67 | 2019-09-19T15:36:59.000Z | 2022-01-13T09:11:54.000Z | runtime/image_classification/models/vgg16/gpus=16_straight/stage10.py | albertsh10/pipedream | cad624f79a71f44ba79099f0c38321347b13e5c2 | [
"MIT"
] | 100 | 2019-09-16T20:59:14.000Z | 2022-03-23T12:56:56.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import torch
class Stage10(torch.nn.Module):
def __init__(self):
super(Stage10, self).__init__()
self.layer1 = torch.nn.Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
self.layer2 = torch.nn.ReLU(... | 39.184211 | 105 | 0.596373 |
1782b420a2321848288590dc58b6078b526c9ac6 | 899 | py | Python | coding202-parsing-json/activity-parse-4.py | bayotheman/coding-skills-sample-code | f75c45bf85474a179857df857cc8836e5f21ecc2 | [
"Apache-2.0"
] | 215 | 2015-02-09T18:43:51.000Z | 2022-03-27T09:07:23.000Z | coding202-parsing-json/activity-parse-4.py | bayotheman/coding-skills-sample-code | f75c45bf85474a179857df857cc8836e5f21ecc2 | [
"Apache-2.0"
] | 9 | 2015-06-24T22:32:22.000Z | 2020-09-17T22:22:39.000Z | coding202-parsing-json/activity-parse-4.py | bayotheman/coding-skills-sample-code | f75c45bf85474a179857df857cc8836e5f21ecc2 | [
"Apache-2.0"
] | 190 | 2015-02-09T18:29:31.000Z | 2022-02-15T23:00:47.000Z | from urllib.request import Request, urlopen
import json
uri_cmx = 'https://devnetapi.cisco.com/sandbox/mse/api/config/v1/maps/info/CiscoCampus'
# Let's wrap our common get functionality in a function definition
def get_content(uri):
req = Request(uri)
req.add_header('Authorization', 'Basic bGVhcm5pbmc6bGVhcm... | 27.242424 | 87 | 0.740823 |
ff0beef64b27289422a85df4940b2ba7f5257911 | 413 | py | Python | lambda2.py | PRASAD-DANGARE/PYTHON | 36214f7dc3762d327e5a29e40752edeb098249c8 | [
"MIT"
] | 1 | 2021-06-07T07:55:28.000Z | 2021-06-07T07:55:28.000Z | lambda2.py | PRASAD-DANGARE/PYTHON | 36214f7dc3762d327e5a29e40752edeb098249c8 | [
"MIT"
] | null | null | null | lambda2.py | PRASAD-DANGARE/PYTHON | 36214f7dc3762d327e5a29e40752edeb098249c8 | [
"MIT"
] | null | null | null | # Python Program Using Lambda Function To Calculate Sum Of Two Numbers
'''
Function Name : Lambda Function To Calculate Sum Of Two Numbers.
Function Date : 8 Sep 2020
Function Author : Prasad Dangare
Input : Float
Output : Float
'''
f = lambda x, y: x + y # Write Lambda Fun... | 31.769231 | 71 | 0.641646 |
8f8ebfc07115953f41ad7c8e17a55c37cd98389b | 4,429 | py | Python | src/estimagic/dashboard/plot_functions.py | janosg/estimagic | 58e17ff94339076f4b7688b1dbef5685f48157e2 | [
"BSD-3-Clause"
] | 7 | 2019-05-11T07:19:46.000Z | 2019-05-31T07:03:13.000Z | src/estimagic/dashboard/plot_functions.py | janosg/estimagic | 58e17ff94339076f4b7688b1dbef5685f48157e2 | [
"BSD-3-Clause"
] | 14 | 2019-05-04T14:15:52.000Z | 2019-06-10T11:45:27.000Z | src/estimagic/dashboard/plot_functions.py | janosg/estimagic | 58e17ff94339076f4b7688b1dbef5685f48157e2 | [
"BSD-3-Clause"
] | 1 | 2019-05-21T08:44:37.000Z | 2019-05-21T08:44:37.000Z | """Helper functions for the dashboard."""
from bokeh.models import HoverTool
from bokeh.models import Legend
from bokeh.plotting import figure
from estimagic.config import GRID_VISIBLE
from estimagic.config import LEGEND_LABEL_TEXT_FONT_SIZE
from estimagic.config import LEGEND_SPACING
from estimagic.config import MAJOR... | 30.544828 | 83 | 0.687514 |
601fe42837bb01ce09c706ae2419c23b8001e79f | 230 | py | Python | aqua/tests/common.py | divyamamgai/integrations-extras | 8c40a9cf870578687cc224ee91d3c70cd3a435a4 | [
"BSD-3-Clause"
] | 158 | 2016-06-02T16:25:31.000Z | 2022-03-16T15:55:14.000Z | aqua/tests/common.py | divyamamgai/integrations-extras | 8c40a9cf870578687cc224ee91d3c70cd3a435a4 | [
"BSD-3-Clause"
] | 554 | 2016-03-15T17:39:12.000Z | 2022-03-31T10:29:16.000Z | aqua/tests/common.py | divyamamgai/integrations-extras | 8c40a9cf870578687cc224ee91d3c70cd3a435a4 | [
"BSD-3-Clause"
] | 431 | 2016-05-13T15:33:13.000Z | 2022-03-31T10:06:46.000Z | # (C) Datadog, Inc. 2019
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from datadog_checks.dev import get_docker_hostname, get_here
HERE = get_here()
HOST = get_docker_hostname()
PORT = '8080'
| 25.555556 | 60 | 0.76087 |
4e4dcc58390964f6462f9ecc6814f7648a10336b | 5,762 | py | Python | mcetl/download/GlobusDownload.py | materials-commons/pymcetl | b4311ba50bb35bc36527b9d313a91778f9550a92 | [
"MIT"
] | null | null | null | mcetl/download/GlobusDownload.py | materials-commons/pymcetl | b4311ba50bb35bc36527b9d313a91778f9550a92 | [
"MIT"
] | null | null | null | mcetl/download/GlobusDownload.py | materials-commons/pymcetl | b4311ba50bb35bc36527b9d313a91778f9550a92 | [
"MIT"
] | null | null | null | import logging
import os
from materials_commons.api import get_project_by_id
from .MaterialsCommonsACLInterface import MaterialsCommonsACLInterface
from ..common.access_exceptions import RequiredAttributeException
from ..common.McdirHelper import McdirHelper
from ..database.DatabaseInterface import DatabaseInterface
... | 41.157143 | 104 | 0.622353 |
fea58feede888178265a32cb7566879a519bd395 | 942 | py | Python | server/axeshome/social.py | kevinmcguinness/axes-home | d41b7e605c8b0d3d6f274eccdd59b3fce794a28b | [
"Apache-2.0"
] | 2 | 2015-06-25T03:10:03.000Z | 2016-02-22T11:34:08.000Z | server/axeshome/social.py | kevinmcguinness/axes-home | d41b7e605c8b0d3d6f274eccdd59b3fce794a28b | [
"Apache-2.0"
] | null | null | null | server/axeshome/social.py | kevinmcguinness/axes-home | d41b7e605c8b0d3d6f274eccdd59b3fce794a28b | [
"Apache-2.0"
] | null | null | null | #
# (c) Copyright 2015 Kevin McGuinness. All Rights Reserved.
#
"""
Social features
"""
import axeshome.backend as backend
from axeshome.api import mongo
def get_video_stats(uri):
uri = backend.fix_uri(uri)
mongo.db.videostats.ensure_index('uri')
stats = mongo.db.videostats.find_one({'uri': uri})
if s... | 27.705882 | 68 | 0.660297 |
6628a9e9541ae14c6f6eb8f793a0d2e491a9b00a | 1,084 | py | Python | test-support/test-repl.py | JakeWheat/burdock | 5626803ea6bb844951cd0205f2eb7cbfa3f2bab5 | [
"BSD-3-Clause"
] | null | null | null | test-support/test-repl.py | JakeWheat/burdock | 5626803ea6bb844951cd0205f2eb7cbfa3f2bab5 | [
"BSD-3-Clause"
] | null | null | null | test-support/test-repl.py | JakeWheat/burdock | 5626803ea6bb844951cd0205f2eb7cbfa3f2bab5 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
"""x
definitely want to try to do an expect in burdock
looked at the documentation for pexpect, and it looks very difficult
to do something general
it's probably fairly easy to write a numpty expect that works well
enough for burdock's automated testing needs, which might be better
this also... | 23.565217 | 70 | 0.653137 |
bd68cbe6f5801e785a59e3b830351b61540d8bfa | 5,565 | py | Python | isi_sdk_8_1_1/isi_sdk_8_1_1/models/event_categories_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_1_1/isi_sdk_8_1_1/models/event_categories_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_1_1/isi_sdk_8_1_1/models/event_categories_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 6
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_8_1_1.models.event_c... | 31.264045 | 170 | 0.600898 |
bc8e7f229c1f54bc983a57247945517401d03081 | 379 | py | Python | py_week_work/week8_032.py | x06lan/mt | 3e4ddacc7717595acbfd689e22cd1e154843b99e | [
"MIT"
] | null | null | null | py_week_work/week8_032.py | x06lan/mt | 3e4ddacc7717595acbfd689e22cd1e154843b99e | [
"MIT"
] | null | null | null | py_week_work/week8_032.py | x06lan/mt | 3e4ddacc7717595acbfd689e22cd1e154843b99e | [
"MIT"
] | null | null | null | save={"0":0,"1":1,"2":1}
def findmap(data,targe):
for i in data:
if i==str(targe):
return data[i]
return None
def F(data,n):
# print(n)
if findmap(data,n)==None:
data[str(n)]=F(data,n-1)+F(data,n-2)
return data[str(n)]
i=int(input())
out=[]
while i!=-1:
out.append(str... | 19.947368 | 44 | 0.530343 |
5a87ae0a84340c3ec13ca388247fe93ccb6daf46 | 1,337 | py | Python | BASS/modules/WebcamVideoStream.py | nrvnrv/yv4cpu | 7e6afd7a5f414f9debe773ac1340c591db6a8adf | [
"MIT"
] | null | null | null | BASS/modules/WebcamVideoStream.py | nrvnrv/yv4cpu | 7e6afd7a5f414f9debe773ac1340c591db6a8adf | [
"MIT"
] | null | null | null | BASS/modules/WebcamVideoStream.py | nrvnrv/yv4cpu | 7e6afd7a5f414f9debe773ac1340c591db6a8adf | [
"MIT"
] | null | null | null | from threading import Thread, Lock
import cv2
class WebcamVideoStream:
def __init__(self, src=0, width=320, height=240):
self.thread = Thread(target=self.update, daemon=True, args=())
self.stream = cv2.VideoCapture(src)
self.stream.set(cv2.CAP_PROP_FRAME_WIDTH, width)
self.stream.s... | 29.711111 | 78 | 0.620045 |
3c4ec0120909bd1598a9b0b52e79bc9f682eff02 | 4,796 | py | Python | language/gpt/train_gpt.py | SaraBakic/ColossalAI-Examples | 072b7c972e166de0965a71a2cb02c95126cdec42 | [
"Apache-2.0"
] | null | null | null | language/gpt/train_gpt.py | SaraBakic/ColossalAI-Examples | 072b7c972e166de0965a71a2cb02c95126cdec42 | [
"Apache-2.0"
] | null | null | null | language/gpt/train_gpt.py | SaraBakic/ColossalAI-Examples | 072b7c972e166de0965a71a2cb02c95126cdec42 | [
"Apache-2.0"
] | null | null | null | from colossalai.context.parallel_mode import ParallelMode
from colossalai.logging import get_dist_logger, disable_existing_loggers
import colossalai
import os
from colossalai.core import global_context as gpc
from colossalai.utils.timer import MultiTimer
from colossalai.zero import zero3_model_context
import colossalai... | 40.302521 | 135 | 0.615721 |
9ae554d21299327aa83bbe496106de88c492d22e | 2,365 | py | Python | setup.py | WanlongCai/tespy | fd00cfaa1872c61a1806a270222de311b3ce0f86 | [
"MIT"
] | null | null | null | setup.py | WanlongCai/tespy | fd00cfaa1872c61a1806a270222de311b3ce0f86 | [
"MIT"
] | null | null | null | setup.py | WanlongCai/tespy | fd00cfaa1872c61a1806a270222de311b3ce0f86 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import io
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext
from setuptools import find_packages
fro... | 31.118421 | 77 | 0.602114 |
9458647a92d1ce4315a0e47ece9db136211589e1 | 2,746 | py | Python | affirm.py | gooli/affirm | 79cf60380be49dfa7b2dfa01ebb5412e06f57f45 | [
"MIT"
] | 48 | 2016-06-03T05:19:20.000Z | 2016-08-01T12:03:33.000Z | affirm.py | gooli/affirm | 79cf60380be49dfa7b2dfa01ebb5412e06f57f45 | [
"MIT"
] | 1 | 2016-10-28T23:44:27.000Z | 2016-10-30T16:41:30.000Z | affirm.py | gooli/affirm | 79cf60380be49dfa7b2dfa01ebb5412e06f57f45 | [
"MIT"
] | 1 | 2016-11-24T07:26:56.000Z | 2016-11-24T07:26:56.000Z | # affirm.py / Eli Finer / 2016
#
# This script causes assert statements to output much better default error messages
# that include the tested condition and the values for any variables referenced in it.
#
# Here are some examples:
#
# >>> assert 1 > 2
# AssertionError: assertion (1 > 2) failed
#
# >>> a = 1; b = 2; c ... | 32.305882 | 106 | 0.619446 |
adec3950d0cdab369b9e36fb61716b4d67b53b3a | 72,990 | py | Python | pyzotero/zotero.py | michi-zuri/pyzotero | c984418524c447eabfcaef935c70becad18c4d54 | [
"MIT"
] | null | null | null | pyzotero/zotero.py | michi-zuri/pyzotero | c984418524c447eabfcaef935c70becad18c4d54 | [
"MIT"
] | null | null | null | pyzotero/zotero.py | michi-zuri/pyzotero | c984418524c447eabfcaef935c70becad18c4d54 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# pylint: disable=R0904
"""
zotero.py
Created by Stephan Hügel on 2011-02-28
This file is part of Pyzotero.
The MIT License (MIT)
Copyright (c) 2015 Stephan Hügel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files... | 36.044444 | 123 | 0.570147 |
7ab5c2106e3d1907bf21b279d952fea9575b3647 | 265 | py | Python | aptitudetech_private/aptitudetech_private/doctype/issue_time_details/issue_time_details.py | CloudGround/aptitudetech_private | d4d150226bd33ea0c76086264286ae7cae52457f | [
"MIT"
] | null | null | null | aptitudetech_private/aptitudetech_private/doctype/issue_time_details/issue_time_details.py | CloudGround/aptitudetech_private | d4d150226bd33ea0c76086264286ae7cae52457f | [
"MIT"
] | null | null | null | aptitudetech_private/aptitudetech_private/doctype/issue_time_details/issue_time_details.py | CloudGround/aptitudetech_private | d4d150226bd33ea0c76086264286ae7cae52457f | [
"MIT"
] | 1 | 2019-05-17T00:04:05.000Z | 2019-05-17T00:04:05.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Aptitudetech and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Issuetimedetails(Document):
pass
| 24.090909 | 51 | 0.788679 |
d3509fa3556c4fab8805b2ea4d69a615e33b405e | 1,340 | py | Python | solutions/022/solve22.py | zsarge/ProjectEuler | 751b19df53483d517e6bf71ccc5fb9918ff50322 | [
"MIT"
] | null | null | null | solutions/022/solve22.py | zsarge/ProjectEuler | 751b19df53483d517e6bf71ccc5fb9918ff50322 | [
"MIT"
] | null | null | null | solutions/022/solve22.py | zsarge/ProjectEuler | 751b19df53483d517e6bf71ccc5fb9918ff50322 | [
"MIT"
] | 1 | 2021-06-07T18:45:07.000Z | 2021-06-07T18:45:07.000Z | # https://projecteuler.net/problem=22
# Run with: 'python solve22.py'
# using Python 3.6.9
# by Zack Sargent
# Prompt:
# Using p022_names.txt,
# a 46K text file containing over five-thousand first names,
# begin by sorting it into alphabetical order.
# Then working out the alphabetical value for each name,
# multiply... | 25.769231 | 63 | 0.671642 |
9c93d80e5a52da798098fdd8e3419c56617f20b5 | 1,760 | py | Python | arekit/common/data/views/samples.py | nicolay-r/AREk | 19c39ec0dc9a17464cade03b9c4da0c6d1d21191 | [
"MIT"
] | 18 | 2019-12-14T18:43:11.000Z | 2022-03-21T05:55:36.000Z | arekit/common/data/views/samples.py | nicolay-r/AREk | 19c39ec0dc9a17464cade03b9c4da0c6d1d21191 | [
"MIT"
] | 284 | 2020-08-08T20:52:44.000Z | 2022-03-31T05:26:20.000Z | arekit/common/data/views/samples.py | nicolay-r/AREk | 19c39ec0dc9a17464cade03b9c4da0c6d1d21191 | [
"MIT"
] | 1 | 2021-08-07T13:17:43.000Z | 2021-08-07T13:17:43.000Z | from arekit.common.data import const
from arekit.common.data.row_ids.base import BaseIDProvider
from arekit.common.data.storages.base import BaseRowsStorage
class BaseSampleStorageView(object):
"""
Pandas-based input samples proovider
"""
def __init__(self, storage, row_ids_provider):
assert(... | 32.592593 | 90 | 0.648295 |
8304ce3e6606b76f2ec3c687035dd3050c02c5ec | 4,840 | py | Python | demo/mmaction2/webcam_demo.py | ZJCV/TSN | ec6ad668d20f477df44eab7035e2553d95a835f3 | [
"Apache-2.0"
] | 2 | 2021-11-29T10:29:40.000Z | 2022-03-22T02:39:44.000Z | demo/mmaction2/webcam_demo.py | ZJCV/TSN | ec6ad668d20f477df44eab7035e2553d95a835f3 | [
"Apache-2.0"
] | 1 | 2022-03-13T09:28:52.000Z | 2022-03-13T09:28:52.000Z | demo/mmaction2/webcam_demo.py | ZJCV/TSN | ec6ad668d20f477df44eab7035e2553d95a835f3 | [
"Apache-2.0"
] | 1 | 2021-03-09T08:14:22.000Z | 2021-03-09T08:14:22.000Z | # -*- coding: utf-8 -*-
"""
@date: 2021/1/14 下午2:51
@file: visualization.py
@author: zj
@description:
"""
from operator import itemgetter
import numpy as np
import torch
from collections import deque
from threading import Thread
from tsn.model.recognizers.build import build_recognizer
from tsn.data.transforms.build... | 32.05298 | 103 | 0.630579 |
ebefab53ec3b80637482261b92bf8029b7543a63 | 10,102 | py | Python | sdk/python/lib/pulumi/runtime/mocks.py | sticha/pulumi | 76ee1b8ccfee815eb315d9e0e0ddfaaf505c472b | [
"Apache-2.0"
] | 1 | 2021-08-22T01:34:11.000Z | 2021-08-22T01:34:11.000Z | sdk/python/lib/pulumi/runtime/mocks.py | sticha/pulumi | 76ee1b8ccfee815eb315d9e0e0ddfaaf505c472b | [
"Apache-2.0"
] | null | null | null | sdk/python/lib/pulumi/runtime/mocks.py | sticha/pulumi | 76ee1b8ccfee815eb315d9e0e0ddfaaf505c472b | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2018, Pulumi Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 37.553903 | 139 | 0.640764 |
60be7f0bb65cdd4fb2502c7dfcd4f8ff265da1b2 | 23,851 | py | Python | lib/rucio/tests/test_subscription.py | llwang00/rucio | f49c5c9599e147823110dc6da22a0bc33a881f8e | [
"Apache-2.0"
] | 1 | 2019-03-15T19:29:35.000Z | 2019-03-15T19:29:35.000Z | lib/rucio/tests/test_subscription.py | llwang00/rucio | f49c5c9599e147823110dc6da22a0bc33a881f8e | [
"Apache-2.0"
] | 58 | 2020-04-14T09:04:04.000Z | 2021-07-13T15:12:59.000Z | lib/rucio/tests/test_subscription.py | llwang00/rucio | f49c5c9599e147823110dc6da22a0bc33a881f8e | [
"Apache-2.0"
] | 1 | 2020-03-02T17:18:14.000Z | 2020-03-02T17:18:14.000Z | # -*- coding: utf-8 -*-
# Copyright 2013-2020 CERN
#
# 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 a... | 60.078086 | 229 | 0.621945 |
cd49468429721093dab5a59de12204cbf09fefea | 3,436 | py | Python | Project/src/Shared/Recomender.py | gasperthegracner/psis2017 | 8f9c74ec788eccea1bc969a2baf080ff75e33e7a | [
"Apache-2.0"
] | null | null | null | Project/src/Shared/Recomender.py | gasperthegracner/psis2017 | 8f9c74ec788eccea1bc969a2baf080ff75e33e7a | [
"Apache-2.0"
] | null | null | null | Project/src/Shared/Recomender.py | gasperthegracner/psis2017 | 8f9c74ec788eccea1bc969a2baf080ff75e33e7a | [
"Apache-2.0"
] | null | null | null | import numpy
import random
import os
class Recommender:
'''
Class for generating recommendation data based input parameters like min intensity,
max intensity, min duration, max duration, min heath rate, max heath rate and training days
'''
def __init__(self, filename="../../Data/clusteredIntensit... | 40.904762 | 148 | 0.595169 |
edbc1d9241418f15d7e6d56e2f8e7cd73bd4c0fc | 27,022 | py | Python | tests/postgres_tests/test_array.py | dmedvinsky/django | f6681393d3f53a67b4e0645e8d02f95579d8ae2d | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2017-02-11T07:07:16.000Z | 2017-02-11T07:07:16.000Z | tests/postgres_tests/test_array.py | dmedvinsky/django | f6681393d3f53a67b4e0645e8d02f95579d8ae2d | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/postgres_tests/test_array.py | dmedvinsky/django | f6681393d3f53a67b4e0645e8d02f95579d8ae2d | [
"PSF-2.0",
"BSD-3-Clause"
] | 2 | 2018-03-30T04:24:48.000Z | 2021-05-09T12:39:09.000Z | import decimal
import json
import unittest
import uuid
from django import forms
from django.core import exceptions, serializers, validators
from django.core.management import call_command
from django.db import IntegrityError, connection, models
from django.test import TransactionTestCase, override_settings
from django... | 37.687587 | 118 | 0.637185 |
9b757b23d0640a3f48fe4929260897d16668b053 | 13,117 | py | Python | privex/jsonrpc/helpers.py | r3st3rcr0w/python-jsonrpc | cdf2fae411a7dac038aedea0d790d43d690f4930 | [
"X11"
] | 2 | 2019-03-18T03:48:25.000Z | 2020-06-25T22:13:54.000Z | privex/jsonrpc/helpers.py | r3st3rcr0w/python-jsonrpc | cdf2fae411a7dac038aedea0d790d43d690f4930 | [
"X11"
] | 1 | 2019-07-17T09:26:59.000Z | 2019-07-17T09:26:59.000Z | privex/jsonrpc/helpers.py | r3st3rcr0w/python-jsonrpc | cdf2fae411a7dac038aedea0d790d43d690f4930 | [
"X11"
] | 2 | 2019-03-23T20:45:41.000Z | 2021-01-09T05:27:52.000Z | import logging
from decimal import Decimal
from privex.jsonrpc.JsonRPC import JsonRPC
from typing import List, Union, Dict
log = logging.getLogger(__name__)
class BitcoinRPC(JsonRPC):
"""
Wrapper class for JsonRPC, with default host 127.0.0.1 and port 8332
Contains pre-defined methods with pydoc for inter... | 46.679715 | 132 | 0.586033 |
806f0a3bfdfab6ee06b775a27c47db7a6c91716c | 1,069 | py | Python | malwarebazaar/platform.py | Rafiot/bazaar | ee61622de49a7ba3fa7c4c8ad07346b36e5e36e0 | [
"MIT"
] | 15 | 2021-06-16T21:25:27.000Z | 2022-02-21T10:48:32.000Z | malwarebazaar/platform.py | Rafiot/bazaar | ee61622de49a7ba3fa7c4c8ad07346b36e5e36e0 | [
"MIT"
] | 3 | 2021-09-28T07:33:21.000Z | 2022-02-21T19:03:23.000Z | malwarebazaar/platform.py | Rafiot/bazaar | ee61622de49a7ba3fa7c4c8ad07346b36e5e36e0 | [
"MIT"
] | 3 | 2021-06-17T20:12:54.000Z | 2022-02-21T09:31:55.000Z | import os
from sys import platform
from rich.console import Console
def is_linux() -> bool:
return platform == "linux"
def is_win() -> bool:
return platform == "win32"
def is_darwin() -> bool:
return platform == "darwin"
def get_config_dir(ec: Console = Console(stderr=True, style="bold red")) -> st... | 23.23913 | 86 | 0.624883 |
97ac4c1ffc51093d5b56fdd99168c098a6c5cd21 | 1,953 | py | Python | model/contact.py | zarinabaisakalova/trainings | 4f8149ffa4797eb678fd5649f29821e1146bd57e | [
"Apache-2.0"
] | null | null | null | model/contact.py | zarinabaisakalova/trainings | 4f8149ffa4797eb678fd5649f29821e1146bd57e | [
"Apache-2.0"
] | null | null | null | model/contact.py | zarinabaisakalova/trainings | 4f8149ffa4797eb678fd5649f29821e1146bd57e | [
"Apache-2.0"
] | null | null | null | _author_ = 'zarina'
from sys import maxsize
class Contact:
def __init__(self, id=None, firstname=None, lastname=None, middlename=None, nickname=None, title=None, company=None,
all_phones_from_home_page=None, all_emails_from_home_page=None,
address=None, homephone=None, mobilepho... | 34.875 | 120 | 0.61956 |
c1be88d05dd0c859c3da3f8b911606e3a8ea43f6 | 1,208 | py | Python | utils/parameters/environment.py | martyw/finance | b323a0224c8152ce1c1ce628d92f4563f3a59f90 | [
"MIT"
] | null | null | null | utils/parameters/environment.py | martyw/finance | b323a0224c8152ce1c1ce628d92f4563f3a59f90 | [
"MIT"
] | null | null | null | utils/parameters/environment.py | martyw/finance | b323a0224c8152ce1c1ce628d92f4563f3a59f90 | [
"MIT"
] | null | null | null | import unittest
from datetime import date
class Environment:
def __init__(self, vd=date(2008, 1, 1)):
self._valuation_date = vd
self.curves = {}
self.surfaces = {}
self.constants = {}
@property
def valuation_date(self):
return self._valuation_date
@valuation_d... | 25.166667 | 52 | 0.61755 |
9a5838da4be758a6471d0ad45394c9a5d7fc1331 | 3,466 | py | Python | tests/test_rand_zoomd.py | loftwah/MONAI | 37fb3e779121e6dc74127993df102fc91d9065f8 | [
"Apache-2.0"
] | 1 | 2020-04-23T13:05:29.000Z | 2020-04-23T13:05:29.000Z | tests/test_rand_zoomd.py | tranduyquockhanh/MONAI | 37fb3e779121e6dc74127993df102fc91d9065f8 | [
"Apache-2.0"
] | null | null | null | tests/test_rand_zoomd.py | tranduyquockhanh/MONAI | 37fb3e779121e6dc74127993df102fc91d9065f8 | [
"Apache-2.0"
] | 1 | 2021-09-20T12:10:01.000Z | 2021-09-20T12:10:01.000Z | # Copyright 2020 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, s... | 41.261905 | 101 | 0.639065 |
a6e7d8ea0751d5d09fa1b14f83214be024a9c8db | 14,881 | py | Python | src/best_params.py | waddupitzme/graph-neural-pde | 004a30c9e838866ac8b78d14b7414224a24014a5 | [
"Apache-2.0"
] | 125 | 2021-06-16T09:36:18.000Z | 2022-03-26T00:16:22.000Z | src/best_params.py | waddupitzme/graph-neural-pde | 004a30c9e838866ac8b78d14b7414224a24014a5 | [
"Apache-2.0"
] | 8 | 2021-06-23T04:49:12.000Z | 2022-03-28T20:25:47.000Z | src/best_params.py | waddupitzme/graph-neural-pde | 004a30c9e838866ac8b78d14b7414224a24014a5 | [
"Apache-2.0"
] | 20 | 2021-06-23T06:55:35.000Z | 2022-03-21T17:04:17.000Z | best_params_dict = {'Cora': {'M_nodes': 64, 'adaptive': False, 'add_source': True, 'adjoint': False, 'adjoint_method': 'adaptive_heun', 'adjoint_step_size': 1, 'alpha': 1.0, 'alpha_dim': 'sc', 'att_samp_pct': 1, 'attention_dim': 128, 'attention_norm_idx': 1, 'attention_rewiring': False, 'attention_type': 'scaled_dot', ... | 1,488.1 | 2,380 | 0.689806 |
af54bb5e0a3cdcb5c9e66d75e27248d701c1652c | 3,720 | py | Python | kubernetes/client/models/v1_volume.py | SEJeff/client-python | baba523c28a684b3f537502977d600dedd1f17c5 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_volume.py | SEJeff/client-python | baba523c28a684b3f537502977d600dedd1f17c5 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_volume.py | SEJeff/client-python | baba523c28a684b3f537502977d600dedd1f17c5 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.5.0-beta.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "Lice... | 28.837209 | 135 | 0.568548 |
b3d17993485d8f2275024e20b40cd628301c3186 | 3,095 | py | Python | models/convnet.py | latimerb/soft_dtree | fac3f3eded0cabe512e3cbf7a2945dcfcfd70fe4 | [
"MIT"
] | 57 | 2018-10-05T07:57:06.000Z | 2022-02-23T19:50:31.000Z | models/convnet.py | latimerb/soft_dtree | fac3f3eded0cabe512e3cbf7a2945dcfcfd70fe4 | [
"MIT"
] | 6 | 2018-10-17T14:21:54.000Z | 2021-03-14T11:07:28.000Z | models/convnet.py | latimerb/soft_dtree | fac3f3eded0cabe512e3cbf7a2945dcfcfd70fe4 | [
"MIT"
] | 27 | 2018-09-10T20:50:53.000Z | 2021-12-08T21:50:12.000Z | import os
import numpy as np
import tensorflow as tf
from tensorflow.keras.layers import (Input, Permute, Conv2D, MaxPooling2D,
Dropout, Flatten, Dense)
from tensorflow.keras.models import Model, load_model
from tensorflow.keras.optimizers import Adam
class ConvNet(object):
de... | 37.289157 | 81 | 0.599354 |
130035b54d4d70de371ccd9fe60922f1f423ae6b | 4,068 | py | Python | leads/migrations/0001_initial.py | rakibul-islam-raju/django-crm | bd2fe84e6662b2d2425d890c64a9f15c3b76127a | [
"MIT"
] | null | null | null | leads/migrations/0001_initial.py | rakibul-islam-raju/django-crm | bd2fe84e6662b2d2425d890c64a9f15c3b76127a | [
"MIT"
] | null | null | null | leads/migrations/0001_initial.py | rakibul-islam-raju/django-crm | bd2fe84e6662b2d2425d890c64a9f15c3b76127a | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-01-14 05:39
from django.conf import settings
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
... | 59.823529 | 329 | 0.639381 |
a7601499b4525ab528a8d05d549bd9d2c6d25b84 | 1,972 | py | Python | PyPortal_Electioncal_US/electioncal/code.py | albinger/Adafruit_Learning_System_Guides | 4fe2da261fe5d1ca282b86bd3b93ee1466346fa7 | [
"MIT"
] | null | null | null | PyPortal_Electioncal_US/electioncal/code.py | albinger/Adafruit_Learning_System_Guides | 4fe2da261fe5d1ca282b86bd3b93ee1466346fa7 | [
"MIT"
] | null | null | null | PyPortal_Electioncal_US/electioncal/code.py | albinger/Adafruit_Learning_System_Guides | 4fe2da261fe5d1ca282b86bd3b93ee1466346fa7 | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2020 Alvaro Figueroa for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import sys
import time
import board
from adafruit_pyportal import PyPortal
cwd = ("/"+__file__).rsplit('/', 1)[0] # the current working directory (where this file is)
sys.path.append(cwd)
import electioncal_graphics... | 32.866667 | 91 | 0.666329 |
e352a8a5ac6bb4a3b63f6a21c10e195cc277a55d | 293 | py | Python | Appendix B/setup.py | lzhang1/BeginningPygame | c239925041a6fa361386f65316ef4bea12c3b482 | [
"MIT"
] | 43 | 2015-09-20T02:05:48.000Z | 2022-03-01T22:00:43.000Z | Appendix B/setup.py | lzhang1/BeginningPygame | c239925041a6fa361386f65316ef4bea12c3b482 | [
"MIT"
] | null | null | null | Appendix B/setup.py | lzhang1/BeginningPygame | c239925041a6fa361386f65316ef4bea12c3b482 | [
"MIT"
] | 40 | 2015-05-19T06:51:13.000Z | 2022-03-27T18:11:16.000Z | import cx_Freeze
executables = [cx_Freeze.Executable("ants_game.py")]
cx_Freeze.setup(
name="Ant Game",
options={"build_exe": {"packages":["pygame"],
"include_files":["ant.png","leaf.png","spider.png",'gameobjects']}},
executables = executables
)
| 24.416667 | 95 | 0.610922 |
40a376b22d8d7348adc8c693ee9c49003b59ccc5 | 6,225 | py | Python | carla/env/env_rendering.py | sebzap/CarlaRL | 5283d15dee9e8dc5e728314d56875b4fbca3acb2 | [
"MIT"
] | null | null | null | carla/env/env_rendering.py | sebzap/CarlaRL | 5283d15dee9e8dc5e728314d56875b4fbca3acb2 | [
"MIT"
] | null | null | null | carla/env/env_rendering.py | sebzap/CarlaRL | 5283d15dee9e8dc5e728314d56875b4fbca3acb2 | [
"MIT"
] | null | null | null | import math
import numpy as np
from contextual_gridworld.environment.colors import IDX_TO_COLOR, COLOR_TO_IDX
from contextual_gridworld.environment.env import load_context_config, Grid, WorldObj
class EnvRenderer:
def __init__(self, total_objects, grid_size=8, tile_size=8, context_config="color_contexts.yaml")... | 30.665025 | 114 | 0.606265 |
0ef523af9a2b173cea183c43fc6e162147490a5f | 629 | py | Python | 46.py | silviuapostu/project-euler-solutions | 6b6c9ca3eee8d351a1e98783f3087a05f6a894fc | [
"MIT"
] | null | null | null | 46.py | silviuapostu/project-euler-solutions | 6b6c9ca3eee8d351a1e98783f3087a05f6a894fc | [
"MIT"
] | null | null | null | 46.py | silviuapostu/project-euler-solutions | 6b6c9ca3eee8d351a1e98783f3087a05f6a894fc | [
"MIT"
] | null | null | null | '''
Goldbach's other conjecture
What is the smallest odd composite that cannot be written as the sum of
a prime and twice a square?
'''
from euler_utils import is_prime
from math import sqrt, ceil
def goldbach2():
n = 35
while True:
if not is_prime(n) and n % 2 == 1:
y = 1
fo... | 20.966667 | 71 | 0.502385 |
48079c5b109413cb6c5f8098890a53c2c13d11fc | 24,486 | py | Python | pybats/dglm.py | bking124/pybats | b99def91901e7a154e95d32e22ceb44a48374f1d | [
"Apache-2.0"
] | 29 | 2019-11-11T14:49:11.000Z | 2022-03-11T13:23:57.000Z | pybats/dglm.py | bking124/pybats | b99def91901e7a154e95d32e22ceb44a48374f1d | [
"Apache-2.0"
] | 7 | 2020-08-04T15:08:54.000Z | 2022-02-26T10:10:16.000Z | pybats/dglm.py | bking124/pybats | b99def91901e7a154e95d32e22ceb44a48374f1d | [
"Apache-2.0"
] | 12 | 2019-11-20T15:21:48.000Z | 2022-02-16T23:18:44.000Z | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/00_dglm.ipynb (unless otherwise specified).
__all__ = ['dglm', 'bern_dglm', 'pois_dglm', 'dlm', 'bin_dglm']
# Internal Cell
from nbdev.showdoc import *
import numpy as np
import scipy as sc
import pandas as pd
from collections.abc import Iterable
from .latent_factor_... | 40.405941 | 179 | 0.58462 |
60560f0b924548bbce6492ff83fd3e3cbc225151 | 2,731 | py | Python | microcosm_daemon/error_policy.py | globality-corp/microcosm-daemon | 86c384462c00d98431d61ed4890b980b0424cb36 | [
"Apache-2.0"
] | null | null | null | microcosm_daemon/error_policy.py | globality-corp/microcosm-daemon | 86c384462c00d98431d61ed4890b980b0424cb36 | [
"Apache-2.0"
] | 10 | 2016-03-25T00:37:22.000Z | 2022-02-09T21:16:16.000Z | microcosm_daemon/error_policy.py | globality-corp/microcosm-daemon | 86c384462c00d98431d61ed4890b980b0424cb36 | [
"Apache-2.0"
] | 2 | 2016-12-19T22:41:21.000Z | 2019-03-17T03:46:31.000Z | """
Error handling policy.
"""
from logging import getLogger
from time import time
from microcosm.api import defaults
from microcosm.config.validation import typed
# nagios style health codes
HEALTH_OK = 0
HEALTH_WARN = 1
HEALTH_ERROR = 2
logger = getLogger("daemon.error_policy")
class ExitError(Exception):
... | 22.94958 | 96 | 0.6342 |
67d3a05e5ef93b7e059e98d1ba2a0dc9410372db | 1,405 | py | Python | ESRGAN/dataset.py | Vrushank264/GANs-PyTorch | 3fe406666ecec74140c36f9670b47da3b2b12a6c | [
"Apache-2.0"
] | 2 | 2021-07-23T16:33:04.000Z | 2021-11-14T06:18:19.000Z | ESRGAN/dataset.py | Vrushank264/GANs-PyTorch | 3fe406666ecec74140c36f9670b47da3b2b12a6c | [
"Apache-2.0"
] | null | null | null | ESRGAN/dataset.py | Vrushank264/GANs-PyTorch | 3fe406666ecec74140c36f9670b47da3b2b12a6c | [
"Apache-2.0"
] | null | null | null | import torch
import os
from PIL import Image
from torch.utils.data import DataLoader, dataset
import torchvision.transforms as T
class TrainDataset(dataset.Dataset):
def __init__(self,
root: str,
img_size: int = 128,
upscale_factor: int = 4):
... | 36.025641 | 109 | 0.482562 |
7e82cc67eb7b7b35fa591c1aa8a29c32edcfc6f3 | 1,794 | py | Python | my_classes/.history/Tuples/modifying_extending_named_tuples_20210723165021.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/.history/Tuples/modifying_extending_named_tuples_20210723165021.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/.history/Tuples/modifying_extending_named_tuples_20210723165021.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | ''' Modifying and extending Named Tuples
Named tuples are immutable
How we can change values inside the tuple
Just like with strings, we have to create a new tuple, with the modified values
Point2D = namedtuple('Point2D', 'x y')
pt = Point2D(0, 0) # will not work
Suppose we need to change t... | 28.47619 | 104 | 0.721293 |
91e81bc985f81d1bfc0d72f13d418290fc12749f | 3,699 | py | Python | tests/test_concept.py | jhosoume/pymfe | b454f8a5470ebd4dbbeb1a7e5570443dd65fdf9a | [
"MIT"
] | null | null | null | tests/test_concept.py | jhosoume/pymfe | b454f8a5470ebd4dbbeb1a7e5570443dd65fdf9a | [
"MIT"
] | null | null | null | tests/test_concept.py | jhosoume/pymfe | b454f8a5470ebd4dbbeb1a7e5570443dd65fdf9a | [
"MIT"
] | null | null | null | """Test module for concept metafeatures."""
import pytest
from pymfe.mfe import MFE
from tests.utils import load_xy
import numpy as np
GNAME = "concept"
class TestConcept:
"""TestClass dedicated to test concept metafeatures."""
@pytest.mark.parametrize(
"dt_id, ft_name, exp_value, precompute",
... | 38.53125 | 72 | 0.510408 |
c4bfc346c4f3ef4270c03733a1072827eb831ffc | 9,931 | py | Python | Core/Rule.py | sybila/eBCSgen | d3e66c84eb908c989d22efbee20e41766948bdec | [
"MIT"
] | 1 | 2020-11-09T15:51:35.000Z | 2020-11-09T15:51:35.000Z | Core/Rule.py | sybila/eBCSgen | d3e66c84eb908c989d22efbee20e41766948bdec | [
"MIT"
] | 33 | 2020-01-29T09:51:45.000Z | 2022-03-30T10:09:32.000Z | Core/Rule.py | sybila/eBCSgen | d3e66c84eb908c989d22efbee20e41766948bdec | [
"MIT"
] | 1 | 2020-09-07T11:24:22.000Z | 2020-09-07T11:24:22.000Z | import collections
import itertools
import random
from copy import copy, deepcopy
from Core import Rate
from Core.Complex import Complex
from Core.Side import Side
from Core.Reaction import Reaction
from TS.State import Multiset
def column(lst, index):
return tuple(map(lambda x: x[index], lst))
class Rule:
... | 37.334586 | 122 | 0.623099 |
1576717bd3476b9dcf7aaeb71fa1a8f1c340eccf | 481 | py | Python | src/pymir-viz/src/config.py | IJtLJZ8Rm4Yr/ymir-backend | 73baa7822bb0d8ec1d152b07d9cabaddb2ae895d | [
"Apache-2.0"
] | null | null | null | src/pymir-viz/src/config.py | IJtLJZ8Rm4Yr/ymir-backend | 73baa7822bb0d8ec1d152b07d9cabaddb2ae895d | [
"Apache-2.0"
] | null | null | null | src/pymir-viz/src/config.py | IJtLJZ8Rm4Yr/ymir-backend | 73baa7822bb0d8ec1d152b07d9cabaddb2ae895d | [
"Apache-2.0"
] | null | null | null | import os
env = os.environ.get
SANDBOX_ROOT = env("SANDBOX_ROOT", '/data/mir_root')
REDIS_URI = env("VIZ_REDIS_URI")
# redis key info
ASSET_ID_DETAIL = "detail"
ASSETS_CLASS_IDS_COUNT = "class_ids_count"
ASSETS_CLASS_ID_INDEX = "index"
# the middle data structure, it will save into cache,like Redis
MIDDLE_STRUCTUR... | 22.904762 | 63 | 0.775468 |
ed453df1490e9088e9b4c10635c07203d93a61f0 | 67 | py | Python | scripts/test/test/dsl.py | cedar101/quepy-ko | 532744e50d9754befeea2eff6a261fa9cd095473 | [
"BSD-3-Clause"
] | null | null | null | scripts/test/test/dsl.py | cedar101/quepy-ko | 532744e50d9754befeea2eff6a261fa9cd095473 | [
"BSD-3-Clause"
] | null | null | null | scripts/test/test/dsl.py | cedar101/quepy-ko | 532744e50d9754befeea2eff6a261fa9cd095473 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
"""
Domain specific language for test quepy.
"""
| 9.571429 | 40 | 0.656716 |
1886db8a9bf3c721e263a166fd04c84d88807c43 | 38,937 | py | Python | vipermonkey/core/vba_object.py | kirk-sayre-work/ViperMonkey | 29078c1042645855a856fabc8db0a8e7780faa22 | [
"Unlicense"
] | 78 | 2017-11-15T13:51:13.000Z | 2022-03-15T09:22:33.000Z | vipermonkey/core/vba_object.py | kirk-sayre-work/ViperMonkey | 29078c1042645855a856fabc8db0a8e7780faa22 | [
"Unlicense"
] | 17 | 2018-09-14T19:14:47.000Z | 2021-11-17T19:03:05.000Z | vipermonkey/core/vba_object.py | kirk-sayre-work/ViperMonkey | 29078c1042645855a856fabc8db0a8e7780faa22 | [
"Unlicense"
] | 13 | 2018-09-12T20:48:16.000Z | 2022-02-07T06:16:24.000Z | """@package vipermonkey.core.vba_object Base class for all VBA objects
and top level functions for evaluating ViperMonkey VBA objects.
"""
# pylint: disable=pointless-string-statement
"""
ViperMonkey: VBA Grammar - Base class for all VBA objects
ViperMonkey is a specialized engine to parse, analyze and interpret Mic... | 37.439423 | 136 | 0.613581 |
74cb3e8e507497c5e505ab1d4fe0a9b05dda8fd9 | 330 | py | Python | app/authentication/api_key_manipulation.py | jabertuhin/fastapi-with-redis | aad3fd2c3c1ae011c43bfb37f29903ef7835026e | [
"MIT"
] | 5 | 2021-08-14T17:08:48.000Z | 2022-01-06T18:29:16.000Z | app/authentication/api_key_manipulation.py | jabertuhin/fastapi-with-redis | aad3fd2c3c1ae011c43bfb37f29903ef7835026e | [
"MIT"
] | 2 | 2021-09-25T11:24:09.000Z | 2021-09-25T11:24:20.000Z | app/authentication/api_key_manipulation.py | jabertuhin/fastapi-with-redis | aad3fd2c3c1ae011c43bfb37f29903ef7835026e | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import NewType
Seconds = NewType("Seconds", int)
def get_api_key_with_time(api_key: str, time: Seconds) -> str:
# Based on minute.
if time//60 == 1:
return f"{api_key}:{str(datetime.now().minute)}"
raise ValueError("Doesn't support other than minute(60 s... | 30 | 70 | 0.693939 |
ddfd8d9c28d3d412e71ea0a77568dad918a38e10 | 501 | py | Python | env/Lib/site-packages/plotly/validators/treemap/marker/colorbar/title/_side.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/Lib/site-packages/plotly/validators/treemap/marker/colorbar/title/_side.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/Lib/site-packages/plotly/validators/treemap/marker/colorbar/title/_side.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class SideValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="side", parent_name="treemap.marker.colorbar.title", **kwargs
):
super(SideValidator, self).__init__(
plotly_name=plotly_name,
pare... | 33.4 | 87 | 0.640719 |
40688750253d0e9bd6a78056ce1a8127fda7c458 | 2,818 | py | Python | disnake/types/raw_models.py | MisileLab/disnake | c7f6a61f2fe2a05cb57027486d6f2cd7fe5399fa | [
"MIT"
] | null | null | null | disnake/types/raw_models.py | MisileLab/disnake | c7f6a61f2fe2a05cb57027486d6f2cd7fe5399fa | [
"MIT"
] | null | null | null | disnake/types/raw_models.py | MisileLab/disnake | c7f6a61f2fe2a05cb57027486d6f2cd7fe5399fa | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015-2021 Rapptz
Copyright (c) 2021-present Disnake Development
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 limi... | 26.838095 | 75 | 0.792406 |
9d715c7f950bf32ec25cddcc64145f7116c79793 | 6,138 | py | Python | eksisozluk.py | teko424/eksisozluk_entries | 1e4c5158a0c2b854c675aabbc9ad92d6399da63a | [
"MIT"
] | null | null | null | eksisozluk.py | teko424/eksisozluk_entries | 1e4c5158a0c2b854c675aabbc9ad92d6399da63a | [
"MIT"
] | null | null | null | eksisozluk.py | teko424/eksisozluk_entries | 1e4c5158a0c2b854c675aabbc9ad92d6399da63a | [
"MIT"
] | null | null | null | # kullanıcı arama, entry sıra numarası özelliği getirilecek
import os
import sys
from subprocess import check_call
try:
import requests
import bs4
except ImportError or ModuleNotFoundError:
packages = ["requests", "BeautifulSoup4", "lxml"]
for package in packages:
check_call(["pip"... | 44.478261 | 117 | 0.40404 |
4efe7aa4b340d1e92817301158cf94aa1f808d19 | 739 | py | Python | pyContabo/types/licenses.py | xLeon-python/pyContabo | 9863bd1ab0f95b50186902c90c40ce53d3026afd | [
"MIT"
] | 5 | 2022-01-03T10:34:35.000Z | 2022-01-27T10:34:41.000Z | pyContabo/types/licenses.py | xLeon-python/pyContabo | 9863bd1ab0f95b50186902c90c40ce53d3026afd | [
"MIT"
] | 4 | 2022-01-14T10:37:57.000Z | 2022-01-20T20:44:54.000Z | pyContabo/types/licenses.py | xLeon-python/pyContabo | 9863bd1ab0f95b50186902c90c40ce53d3026afd | [
"MIT"
] | 1 | 2022-01-20T14:59:32.000Z | 2022-01-20T14:59:32.000Z | from enum import Enum
class license(Enum):
PleskHost = "PleskHost"
PleskPro = "PleskPro"
PleskAdmin = "PleskAdmin"
cPanel5 = "cPanel5"
cPanel30 = "cPanel30"
cPanel50 = "cPanel50"
cPanel100 = "cPanel100"
cPanel150 = "cPanel150"
cPanel200 = "cPanel200"
cPanel250 = "cPanel250"
... | 24.633333 | 29 | 0.64682 |
45d6e11b18fc8ca746bae139df7d082c8efd5b60 | 13,008 | py | Python | PathPlanning/HybridAStar/hybrid_a_star.py | pruidzeko/PythonRobotics | 5ff9b70d737121c2947d844ecfb1fa07abdd210c | [
"MIT"
] | 5 | 2021-01-24T12:06:36.000Z | 2022-03-05T18:32:15.000Z | PathPlanning/HybridAStar/hybrid_a_star.py | pruidzeko/PythonRobotics | 5ff9b70d737121c2947d844ecfb1fa07abdd210c | [
"MIT"
] | 61 | 2020-08-17T20:02:09.000Z | 2022-03-14T20:01:01.000Z | PathPlanning/HybridAStar/hybrid_a_star.py | pruidzeko/PythonRobotics | 5ff9b70d737121c2947d844ecfb1fa07abdd210c | [
"MIT"
] | 1 | 2021-05-02T09:26:52.000Z | 2021-05-02T09:26:52.000Z | """
Hybrid A* path planning
author: Zheng Zh (@Zhengzh)
"""
import heapq
import math
import os
import sys
import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial import cKDTree
sys.path.append(os.path.dirname(os.path.abspath(__file__))
+ "/../ReedsSheppPath")
try:
from a_star_heu... | 29.100671 | 79 | 0.58956 |
d29aa590873ef7d8f492b2cd43450e694776f457 | 1,216 | py | Python | python_toolbox/address_tools/shared.py | hboshnak/python_toolbox | cb9ef64b48f1d03275484d707dc5079b6701ad0c | [
"MIT"
] | 119 | 2015-02-05T17:59:47.000Z | 2022-02-21T22:43:40.000Z | python_toolbox/address_tools/shared.py | hboshnak/python_toolbox | cb9ef64b48f1d03275484d707dc5079b6701ad0c | [
"MIT"
] | 4 | 2019-04-24T14:01:14.000Z | 2020-05-21T12:03:29.000Z | python_toolbox/address_tools/shared.py | hboshnak/python_toolbox | cb9ef64b48f1d03275484d707dc5079b6701ad0c | [
"MIT"
] | 14 | 2015-03-30T06:30:42.000Z | 2021-12-24T23:45:11.000Z | # Copyright 2009-2017 Ram Rachum.
# This program is distributed under the MIT license.
'''Various objects and tools for `address_tools`.'''
import re
_address_pattern = re.compile(
r"^(?P<address>([a-zA-Z_][0-9a-zA-Z_]*)(\.[a-zA-Z_][0-9a-zA-Z_]*)*)$"
)
'''Pattern for Python addresses, like 'email.encoders'.'''
... | 26.434783 | 76 | 0.674342 |
577988bc58ca65fe8c92317e1008aabab8080c44 | 12,475 | py | Python | homeassistant/components/media_player/yamaha.py | dotlambda/home-assistant | 68d2851ecf2dcd05bd5197240a31980d4fee8d2e | [
"Apache-2.0"
] | null | null | null | homeassistant/components/media_player/yamaha.py | dotlambda/home-assistant | 68d2851ecf2dcd05bd5197240a31980d4fee8d2e | [
"Apache-2.0"
] | 5 | 2022-03-01T06:31:03.000Z | 2022-03-31T07:20:45.000Z | homeassistant/components/media_player/yamaha.py | dotlambda/home-assistant | 68d2851ecf2dcd05bd5197240a31980d4fee8d2e | [
"Apache-2.0"
] | null | null | null | """
Support for Yamaha Receivers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.yamaha/
"""
import logging
import voluptuous as vol
from homeassistant.components.media_player import (
SUPPORT_TURN_OFF, SUPPORT_TURN_ON, SUPPORT_VOLUME_... | 34.943978 | 79 | 0.647375 |
1a4f0876e2404ab4eb5abae22c4c2ec27f4f0d12 | 13,209 | py | Python | bson/codec_options.py | educatornum/mongo-python-driver | 2cb34e4efc84445abb18c45572b2a35c4a81d3e5 | [
"Apache-2.0"
] | 1 | 2020-03-09T02:18:46.000Z | 2020-03-09T02:18:46.000Z | bson/codec_options.py | educatornum/mongo-python-driver | 2cb34e4efc84445abb18c45572b2a35c4a81d3e5 | [
"Apache-2.0"
] | null | null | null | bson/codec_options.py | educatornum/mongo-python-driver | 2cb34e4efc84445abb18c45572b2a35c4a81d3e5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 41.149533 | 94 | 0.65304 |
f90e5df321138c4504824397a5f4efe2a1507724 | 10,081 | py | Python | mysql-utilities-1.6.0/mysql/utilities/common/my_print_defaults.py | bopopescu/mysql-dbcompare | 1e912fd87282be3b3bed48487e6beb0ecb1de339 | [
"Apache-2.0"
] | 2 | 2018-03-20T07:42:58.000Z | 2018-03-20T07:43:49.000Z | mysql-utilities-1.6.0/mysql/utilities/common/my_print_defaults.py | bopopescu/mysql-dbcompare | 1e912fd87282be3b3bed48487e6beb0ecb1de339 | [
"Apache-2.0"
] | null | null | null | mysql-utilities-1.6.0/mysql/utilities/common/my_print_defaults.py | bopopescu/mysql-dbcompare | 1e912fd87282be3b3bed48487e6beb0ecb1de339 | [
"Apache-2.0"
] | 1 | 2020-07-23T23:07:08.000Z | 2020-07-23T23:07:08.000Z | #
# Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope ... | 38.477099 | 79 | 0.587938 |
d6e06f81661d07232a619729c3e4935b6c5ade3e | 2,420 | py | Python | FV3.py | RupakMukherjee/FiniteVolumeTensorFlow | 64745990e856b4e172cc2b0b246970985adbcbdb | [
"MIT"
] | null | null | null | FV3.py | RupakMukherjee/FiniteVolumeTensorFlow | 64745990e856b4e172cc2b0b246970985adbcbdb | [
"MIT"
] | null | null | null | FV3.py | RupakMukherjee/FiniteVolumeTensorFlow | 64745990e856b4e172cc2b0b246970985adbcbdb | [
"MIT"
] | null | null | null | import numpy as np
from matplotlib import pyplot as plt
def set_params():
global xmin, xmax, c, t_end, nx, cfl, n_ghost
xmin=0.0
xmax=1.0
c = 1.0
t_end = 1.0
nx = 100
cfl = 0.1
n_ghost = 3
def set_init():
global time, dx, dt, js, je, nt, x, xb, u, u_init, flux
time = 0.0
... | 21.22807 | 77 | 0.489669 |
992aca5f808ab0d5db7f4b7a08610648ec6a3648 | 7,094 | py | Python | ehr_prediction_modeling/eval/metrics_coordinator.py | google/ehr-predictions | 811d3087ced4f92d28f98161478ff0ad6b571ad4 | [
"Apache-2.0"
] | 67 | 2021-02-19T08:01:48.000Z | 2022-03-31T15:05:18.000Z | ehr_prediction_modeling/eval/metrics_coordinator.py | higuseonhye/ehr-predictions | 811d3087ced4f92d28f98161478ff0ad6b571ad4 | [
"Apache-2.0"
] | null | null | null | ehr_prediction_modeling/eval/metrics_coordinator.py | higuseonhye/ehr-predictions | 811d3087ced4f92d28f98161478ff0ad6b571ad4 | [
"Apache-2.0"
] | 8 | 2021-06-29T10:57:57.000Z | 2022-03-03T10:33:06.000Z | # coding=utf-8
# Copyright 2021 Google Health Research.
#
# 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 la... | 39.411111 | 80 | 0.708204 |
485e4a1231e7aa20721872c9bae63348056a91f4 | 10,456 | py | Python | netbox/ipam/tables/ip.py | salvapinyol/netbox | c9c537a1b9b4cadb9c29579f984e1f96c2583792 | [
"Apache-2.0"
] | null | null | null | netbox/ipam/tables/ip.py | salvapinyol/netbox | c9c537a1b9b4cadb9c29579f984e1f96c2583792 | [
"Apache-2.0"
] | null | null | null | netbox/ipam/tables/ip.py | salvapinyol/netbox | c9c537a1b9b4cadb9c29579f984e1f96c2583792 | [
"Apache-2.0"
] | null | null | null | import django_tables2 as tables
from django.utils.safestring import mark_safe
from django_tables2.utils import Accessor
from tenancy.tables import TenantColumn
from utilities.tables import (
BaseTable, BooleanColumn, ButtonsColumn, ChoiceFieldColumn, LinkedCountColumn, TagColumn,
ToggleColumn, UtilizationColum... | 28.107527 | 372 | 0.597839 |
7a2126241d8aac84b8e65cd834cdb92e6dc4cfeb | 5,401 | py | Python | tests/python/pants_test/backend/jvm/tasks/test_scalafmt.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/backend/jvm/tasks/test_scalafmt.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/backend/jvm/tasks/test_scalafmt.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from textwrap import dedent
from pants.backend.jvm.subsystems.scala_platform i... | 36.993151 | 100 | 0.71172 |
f4173f5d05b709238ff6014e3c5c9daa00214d82 | 16,020 | py | Python | tensorflow/contrib/distributions/python/kernel_tests/shape_test.py | danielgordon10/tensorflow | 395cfc42ee3c5842f5383f4049674c012998b133 | [
"Apache-2.0"
] | 101 | 2016-12-03T11:40:52.000Z | 2017-12-23T02:02:03.000Z | tensorflow/contrib/distributions/python/kernel_tests/shape_test.py | danielgordon10/tensorflow | 395cfc42ee3c5842f5383f4049674c012998b133 | [
"Apache-2.0"
] | 9 | 2016-12-14T03:27:46.000Z | 2017-09-13T02:29:07.000Z | tensorflow/contrib/distributions/python/kernel_tests/shape_test.py | danielgordon10/tensorflow | 395cfc42ee3c5842f5383f4049674c012998b133 | [
"Apache-2.0"
] | 47 | 2016-12-04T12:37:24.000Z | 2018-01-14T18:13:07.000Z | # Copyright 2016 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... | 44.010989 | 80 | 0.640762 |
787530f9fb6cac8866eb3f59725d22d9e52b2ade | 6,330 | py | Python | magenta/models/image_stylization/image_stylization_train.py | sandutsar/magenta | 77ed668af96edea7c993d38973b9da342bd31e82 | [
"Apache-2.0"
] | 16,143 | 2016-05-14T04:44:54.000Z | 2020-06-04T06:48:38.000Z | magenta/models/image_stylization/image_stylization_train.py | sandutsar/magenta | 77ed668af96edea7c993d38973b9da342bd31e82 | [
"Apache-2.0"
] | 1,076 | 2016-05-19T14:13:43.000Z | 2020-06-04T16:36:51.000Z | magenta/models/image_stylization/image_stylization_train.py | sandutsar/magenta | 77ed668af96edea7c993d38973b9da342bd31e82 | [
"Apache-2.0"
] | 3,584 | 2016-05-14T05:55:19.000Z | 2020-06-04T17:53:50.000Z | # Copyright 2022 The Magenta 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 ... | 41.92053 | 80 | 0.67109 |
645ecf8a5894f3c76b76ec6bd283c345481ab69d | 15,247 | py | Python | corehq/apps/users/bulk_download.py | omari-funzone/commcare-hq | 5edb462c891fc08e51c4babd7acdf12c0006a602 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/users/bulk_download.py | omari-funzone/commcare-hq | 5edb462c891fc08e51c4babd7acdf12c0006a602 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/users/bulk_download.py | omari-funzone/commcare-hq | 5edb462c891fc08e51c4babd7acdf12c0006a602 | [
"BSD-3-Clause"
] | null | null | null | import uuid
from django.conf import settings
from django.utils.translation import ugettext
from couchexport.writers import Excel2007ExportWriter
from soil import DownloadBase
from soil.util import expose_download, get_download_file_path
from corehq import privileges
from corehq import toggles
from corehq.apps.accoun... | 36.651442 | 115 | 0.690496 |
ea2c86963330133a50d012a86f2b2e6356f949e6 | 3,163 | py | Python | Sensor_python_code/homework_and_develop/a12_sensor_read.py | Eric-IoT-2019-summer/QI_D_team | c317c9302ee843223c5d9387db3b3ad67dc78ce2 | [
"MIT"
] | 1 | 2021-03-28T15:54:13.000Z | 2021-03-28T15:54:13.000Z | Sensor_python_code/homework_and_develop/a12_sensor_read.py | Eric-IoT-2019-summer/QI_D_team | c317c9302ee843223c5d9387db3b3ad67dc78ce2 | [
"MIT"
] | 2 | 2021-03-28T15:49:07.000Z | 2021-05-10T03:37:02.000Z | Sensor_python_code/homework_and_develop/a12_sensor_read.py | Eric-IoT-2019-summer/QI_D_team | c317c9302ee843223c5d9387db3b3ad67dc78ce2 | [
"MIT"
] | null | null | null | import time
WE0, AE0 = [295,391,347,345], [282, 390, 296, 255]
select_pin, Sen = [24, 25, 26, 27], [0.228, 0.399, 0.267, 0.318]
n, en_bit, mode, delay= [1.18, 0.18, 0.03, 1.15], 28, 0, 1
for i in range(0, 5):
pin_direction = open("/gpio/pin" + str(i + 24) + "/direction", 'w')
pin_direction.write("out"... | 27.745614 | 84 | 0.516914 |
7889b7f2c73639b128a1ae3532293e2fbe31c47f | 2,557 | py | Python | bot/database.py | mawanda-jun/tnt-village-bot | f1246bf97bca369ce0a196a75ef763da74c44c17 | [
"MIT"
] | null | null | null | bot/database.py | mawanda-jun/tnt-village-bot | f1246bf97bca369ce0a196a75ef763da74c44c17 | [
"MIT"
] | null | null | null | bot/database.py | mawanda-jun/tnt-village-bot | f1246bf97bca369ce0a196a75ef763da74c44c17 | [
"MIT"
] | null | null | null | import logging
import simplesqlitewrap as ssw
from bot import sql
from .utils import utils
logger = logging.getLogger(__name__)
CATEGORIE = {
1: 'Film TV e programmi',
2: 'Musica',
3: 'E Books',
4: 'Film',
6: 'Linux',
7: 'Anime',
8: 'Cartoni',
9: 'Macintosh',
10: 'Windows Softwa... | 29.390805 | 157 | 0.62808 |
56a0f08f2d3f48d36de7dce577fa0e2dd11d1fad | 815 | py | Python | src/griddlers/cells_section.py | saroad2/griddlers | 7b90b777c7a22db3511d462cefe78ada29e4512e | [
"Apache-2.0"
] | 1 | 2021-03-31T08:44:54.000Z | 2021-03-31T08:44:54.000Z | src/griddlers/cells_section.py | saroad2/griddlers | 7b90b777c7a22db3511d462cefe78ada29e4512e | [
"Apache-2.0"
] | null | null | null | src/griddlers/cells_section.py | saroad2/griddlers | 7b90b777c7a22db3511d462cefe78ada29e4512e | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass, field
from griddlers.cell_mark import CellMark
@dataclass
class CellsSection:
start: int
end: int
mark: CellMark
blocked_below: bool = field(default=False)
blocked_above: bool = field(default=False)
def __post_init__(self):
if self.start > self.end... | 23.285714 | 68 | 0.625767 |
9a2f81d45c372b577249566a0bf3054f18692a29 | 389 | py | Python | tests/admin_docs/views.py | fizista/django | 16f3a6a4c7bab11644d11c2be029374e5095cb56 | [
"BSD-3-Clause"
] | 2 | 2016-07-23T18:08:37.000Z | 2016-07-24T09:54:34.000Z | tests/admin_docs/views.py | fizista/django | 16f3a6a4c7bab11644d11c2be029374e5095cb56 | [
"BSD-3-Clause"
] | null | null | null | tests/admin_docs/views.py | fizista/django | 16f3a6a4c7bab11644d11c2be029374e5095cb56 | [
"BSD-3-Clause"
] | 1 | 2020-10-01T08:23:34.000Z | 2020-10-01T08:23:34.000Z | from django.http import HttpResponse
from django.utils.decorators import decorator_from_middleware
from django.views.generic import View
from django.contrib.admindocs.middleware import XViewMiddleware
xview_dec = decorator_from_middleware(XViewMiddleware)
def xview(request):
return HttpResponse()
class XViewCl... | 24.3125 | 63 | 0.804627 |
e836d3af16e1f7a2ffe47c2f96d05b2bcc450457 | 16 | py | Python | metrics/__init__.py | ElementAI/wise_ils | f0897b4aae042c2085eeb13b38c2a26b43cb8eaf | [
"Apache-2.0"
] | 24 | 2019-08-08T22:00:14.000Z | 2021-01-28T01:45:51.000Z | metrics/__init__.py | JaringAu/wise_ils | 4e8bca05d834a80a5aff5e7c6e84dd3a283b399b | [
"Apache-2.0"
] | 6 | 2019-08-12T03:05:23.000Z | 2020-07-27T21:26:12.000Z | metrics/__init__.py | JaringAu/wise_ils | 4e8bca05d834a80a5aff5e7c6e84dd3a283b399b | [
"Apache-2.0"
] | 8 | 2019-08-08T22:15:02.000Z | 2021-01-28T01:45:52.000Z | from . import ap | 16 | 16 | 0.75 |
c5693d0e05dc66524803afad5039c32f95313edd | 5,994 | py | Python | examples/characterization/active-reset/configuration.py | qua-platform/qua-libs | 805a3b1a69980b939b370b3ba09434bc26dc45ec | [
"BSD-3-Clause"
] | 21 | 2021-05-21T08:23:34.000Z | 2022-03-25T11:30:55.000Z | examples/characterization/active-reset/configuration.py | qua-platform/qua-libs | 805a3b1a69980b939b370b3ba09434bc26dc45ec | [
"BSD-3-Clause"
] | 9 | 2021-05-13T19:56:00.000Z | 2021-12-21T05:11:04.000Z | examples/characterization/active-reset/configuration.py | qua-platform/qua-libs | 805a3b1a69980b939b370b3ba09434bc26dc45ec | [
"BSD-3-Clause"
] | 2 | 2021-06-21T10:56:40.000Z | 2021-12-19T14:21:33.000Z | import numpy as np
######################
# AUXILIARY FUNCTIONS:
######################
def gauss(amplitude, mu, sigma, length):
t = np.linspace(-length / 2, length / 2, length)
gauss_wave = amplitude * np.exp(-((t - mu) ** 2) / (2 * sigma ** 2))
return [float(x) for x in gauss_wave]
def IQ_imbalance(g... | 30.896907 | 87 | 0.412079 |
aa8df3c54204b59f64e82bd3007dddef5e13adb6 | 2,127 | py | Python | models.py | tensorway/self-supervised-vision | 824e9e66841f98f0b84d2f89e05f72ffd115b32b | [
"MIT"
] | null | null | null | models.py | tensorway/self-supervised-vision | 824e9e66841f98f0b84d2f89e05f72ffd115b32b | [
"MIT"
] | null | null | null | models.py | tensorway/self-supervised-vision | 824e9e66841f98f0b84d2f89e05f72ffd115b32b | [
"MIT"
] | null | null | null | #%%
import timm
import torch as th
import torch
from torch import nn
from mini_resnet import get_mini_resnet
import torch.nn.functional as F
class BenchmarkModel(nn.Module):
def __init__(
self,
projector_mlp_arch,
model_name='mini_resnet20',
n_classes = 10,
):
'''
... | 28.743243 | 99 | 0.598025 |
71f54a048a9fda118bfd535a9cd0ccad55d7dc00 | 6,696 | py | Python | regulations/tests/layers_appliers_test.py | navigo/regulations-site | 910c24e46f4e921210a40da452dff69feae692d4 | [
"CC0-1.0"
] | 18 | 2016-09-22T05:05:16.000Z | 2021-07-28T18:13:48.000Z | regulations/tests/layers_appliers_test.py | navigo/regulations-site | 910c24e46f4e921210a40da452dff69feae692d4 | [
"CC0-1.0"
] | 260 | 2016-04-05T22:06:10.000Z | 2021-01-07T22:08:15.000Z | regulations/tests/layers_appliers_test.py | navigo/regulations-site | 910c24e46f4e921210a40da452dff69feae692d4 | [
"CC0-1.0"
] | 25 | 2016-04-06T03:26:42.000Z | 2020-10-19T16:49:23.000Z | from unittest import TestCase
from regulations.generator.layers import layers_applier
from regulations.generator.layers import location_replace
class LayersApplierTest(TestCase):
def test_enqueue(self):
applier = layers_applier.LayersApplier()
element = ('abcd', 'ABCD', [])
applier.enqueu... | 40.095808 | 78 | 0.586619 |
26eb9412f376c37bcb5585de67cd77a21f42d589 | 14,038 | py | Python | mopidy/mpd/protocol/current_playlist.py | stekern/mopidy | 94509cf70f2bd35ebb13e746dde135bfbe35ce0e | [
"Apache-2.0"
] | null | null | null | mopidy/mpd/protocol/current_playlist.py | stekern/mopidy | 94509cf70f2bd35ebb13e746dde135bfbe35ce0e | [
"Apache-2.0"
] | null | null | null | mopidy/mpd/protocol/current_playlist.py | stekern/mopidy | 94509cf70f2bd35ebb13e746dde135bfbe35ce0e | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, unicode_literals
from mopidy.compat import urllib
from mopidy.internal import deprecation
from mopidy.mpd import exceptions, protocol, translator
@protocol.commands.add('add')
def add(context, uri):
"""
*musicpd.org, current playlist section:*
``add {URI}``
... | 31.057522 | 79 | 0.651375 |
c78072131bafa478fff617e72c364ee9f6380944 | 80,434 | py | Python | salt/modules/state.py | waynegemmell/salt | 88056db3589cccab8956c2ae4f9b733acce89461 | [
"Apache-2.0"
] | 9,425 | 2015-01-01T05:59:24.000Z | 2022-03-31T20:44:05.000Z | salt/modules/state.py | waynegemmell/salt | 88056db3589cccab8956c2ae4f9b733acce89461 | [
"Apache-2.0"
] | 33,507 | 2015-01-01T00:19:56.000Z | 2022-03-31T23:48:20.000Z | salt/modules/state.py | waynegemmell/salt | 88056db3589cccab8956c2ae4f9b733acce89461 | [
"Apache-2.0"
] | 5,810 | 2015-01-01T19:11:45.000Z | 2022-03-31T02:37:20.000Z | """
Control the state system on the minion.
State Caching
-------------
When a highstate is called, the minion automatically caches a copy of the last
high data. If you then run a highstate with cache=True it will use that cached
highdata and won't hit the fileserver except for ``salt://`` links in the
states themsel... | 31.994431 | 147 | 0.613808 |
d669123a9292d3bf1da68d1ae90f3abe98538e95 | 6,891 | py | Python | register/forms.py | cds-snc/covid-alert-portal | e7d56fa9fa4a2ad2d60f056eae063713661bd260 | [
"MIT"
] | 43 | 2020-07-31T14:38:06.000Z | 2022-03-07T11:28:28.000Z | register/forms.py | cds-snc/covid-alert-portal | e7d56fa9fa4a2ad2d60f056eae063713661bd260 | [
"MIT"
] | 322 | 2020-07-23T19:38:26.000Z | 2022-03-31T19:15:45.000Z | register/forms.py | cds-snc/covid-alert-portal | e7d56fa9fa4a2ad2d60f056eae063713661bd260 | [
"MIT"
] | 6 | 2020-11-28T19:30:20.000Z | 2021-07-29T18:06:55.000Z | import re
from django import forms
from django.core.validators import RegexValidator
from portal.forms import HealthcareBaseForm
from django.utils.translation import gettext_lazy as _
from portal.widgets import CDSRadioWidget
from phonenumber_field.formfields import PhoneNumberField
from dependency_injector.wiring imp... | 31.040541 | 109 | 0.674358 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.