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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a8ffead09712a28a83adfd83561573aa6b1ab922 | 3,768 | py | Python | src/models/loaders/mobilenet.py | takedarts/skipresnet | d6f1e16042f8433a287355009e17e4e5768ad319 | [
"MIT"
] | 3 | 2022-02-03T13:25:12.000Z | 2022-02-04T16:12:23.000Z | src/models/loaders/mobilenet.py | takedarts/skipresnet | d6f1e16042f8433a287355009e17e4e5768ad319 | [
"MIT"
] | null | null | null | src/models/loaders/mobilenet.py | takedarts/skipresnet | d6f1e16042f8433a287355009e17e4e5768ad319 | [
"MIT"
] | 1 | 2022-02-04T12:28:02.000Z | 2022-02-04T12:28:02.000Z | from typing import Any
def load_mobilenetv2_parameters(model: Any, timm_model: Any) -> None:
model.stem.conv.load_state_dict(timm_model.conv_stem.state_dict())
model.stem.norm.load_state_dict(timm_model.bn1.state_dict())
index = 0
for stage in timm_model.blocks:
for ref_block in stage:
... | 55.411765 | 98 | 0.680998 |
11c278cc137899c6c3d22b61e036ca66134f56fc | 725 | py | Python | 429.py | RafaelHuang87/Leet-Code-Practice | 7754dcee38ffda18a5759113ef06d7becf4fe728 | [
"MIT"
] | null | null | null | 429.py | RafaelHuang87/Leet-Code-Practice | 7754dcee38ffda18a5759113ef06d7becf4fe728 | [
"MIT"
] | null | null | null | 429.py | RafaelHuang87/Leet-Code-Practice | 7754dcee38ffda18a5759113ef06d7becf4fe728 | [
"MIT"
] | null | null | null | """
# Definition for a Node.
class Node:
def __init__(self, val=None, children=None):
self.val = val
self.children = children
"""
class Solution:
def levelOrder(self, root: 'Node') -> List[List[int]]:
import collections
res = []
que = collections.deque()
que.app... | 25 | 58 | 0.475862 |
6f24fb322a625c1026286b14a4643582b40a9b9b | 3,427 | py | Python | backend/datasets_model.py | linz/geospatial-data-lake | e92fb2fc0e050da471e3ecbc1c0331c551612092 | [
"MIT"
] | 5 | 2021-02-04T01:07:20.000Z | 2021-04-16T09:35:21.000Z | backend/datasets_model.py | linz/geospatial-data-lake | e92fb2fc0e050da471e3ecbc1c0331c551612092 | [
"MIT"
] | 252 | 2020-10-26T10:34:43.000Z | 2021-05-17T04:21:08.000Z | backend/datasets_model.py | linz/geospatial-data-lake | e92fb2fc0e050da471e3ecbc1c0331c551612092 | [
"MIT"
] | 1 | 2021-05-05T04:23:32.000Z | 2021-05-05T04:23:32.000Z | from os import environ
from typing import Any, Dict, Optional, Tuple, Type
from pynamodb.attributes import UTCDateTimeAttribute, UnicodeAttribute
from pynamodb.indexes import AllProjection, GlobalSecondaryIndex
from pynamodb.models import MetaModel, Model
from ulid import ULID, new
from .aws_keys import AWS_DEFAULT_R... | 32.638095 | 100 | 0.681062 |
c8581c64cb13bc53ecd3514670887a2fbaeeadcb | 1,780 | py | Python | cinder/tests/unit/volume/drivers/sandstone/test_utils.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 571 | 2015-01-01T17:47:26.000Z | 2022-03-23T07:46:36.000Z | cinder/tests/unit/volume/drivers/sandstone/test_utils.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 37 | 2015-01-22T23:27:04.000Z | 2021-02-05T16:38:48.000Z | cinder/tests/unit/volume/drivers/sandstone/test_utils.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 841 | 2015-01-04T17:17:11.000Z | 2022-03-31T12:06:51.000Z | # Copyright (c) 2019 ShenZhen SandStone Data Technologies Co., Ltd.
# 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/... | 32.363636 | 78 | 0.624719 |
4b0d91463e229997e36374afbafb67d38249d665 | 13,374 | py | Python | certbot-dns-google/certbot_dns_google/_internal/dns_google.py | sommersoft/certbot | 2a16aa16c37308dd0e357d96b51d2b0ffb36add8 | [
"Apache-2.0"
] | null | null | null | certbot-dns-google/certbot_dns_google/_internal/dns_google.py | sommersoft/certbot | 2a16aa16c37308dd0e357d96b51d2b0ffb36add8 | [
"Apache-2.0"
] | 1 | 2021-01-25T14:47:33.000Z | 2021-01-25T15:00:46.000Z | certbot-dns-google/certbot_dns_google/_internal/dns_google.py | sommersoft/certbot | 2a16aa16c37308dd0e357d96b51d2b0ffb36add8 | [
"Apache-2.0"
] | null | null | null | """DNS Authenticator for Google Cloud DNS."""
import json
import logging
from googleapiclient import discovery
from googleapiclient import errors as googleapiclient_errors
import httplib2
from oauth2client.service_account import ServiceAccountCredentials
import zope.interface
from certbot import errors
from certbot i... | 42.056604 | 154 | 0.602213 |
40a1167f874d021a91bc455528bcbc3a21c4257b | 2,970 | py | Python | Cantera-data-examples/examples/kinetics/mechanism_reduction.py | vincentrobin/conda | 54ff4acb95721c54996b2b6378498dd439b42b6d | [
"BSD-3-Clause"
] | 1 | 2020-10-09T05:19:16.000Z | 2020-10-09T05:19:16.000Z | Cantera-data-examples/examples/kinetics/mechanism_reduction.py | vincentrobin/conda | 54ff4acb95721c54996b2b6378498dd439b42b6d | [
"BSD-3-Clause"
] | null | null | null | Cantera-data-examples/examples/kinetics/mechanism_reduction.py | vincentrobin/conda | 54ff4acb95721c54996b2b6378498dd439b42b6d | [
"BSD-3-Clause"
] | null | null | null | """
A simplistic approach to mechanism reduction which demonstrates Cantera's
features for dynamically manipulating chemical mechanisms.
Here, we use the full GRI 3.0 mechanism to simulate adiabatic, constant pressure
ignition of a lean methane/air mixture. We track the maximum reaction rates for
each reaction to dete... | 32.637363 | 80 | 0.690572 |
ff61afb2800055edb5712999f13260dfc2100e9c | 8,359 | py | Python | plaso/parsers/apache_access.py | kovakina/plaso | 312820b2256013c9167963e40e74ba2eadaece3b | [
"Apache-2.0"
] | null | null | null | plaso/parsers/apache_access.py | kovakina/plaso | 312820b2256013c9167963e40e74ba2eadaece3b | [
"Apache-2.0"
] | null | null | null | plaso/parsers/apache_access.py | kovakina/plaso | 312820b2256013c9167963e40e74ba2eadaece3b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Apache access log (access.log) parser.
Parser based on the two default apache formats, common and combined log format
defined in https://httpd.apache.org/docs/2.4/logs.html
"""
from __future__ import unicode_literals
import pyparsing
from dfdatetime import time_elements as dfdatetime_time... | 37.316964 | 79 | 0.705108 |
3f6df92eef16ef2a2f3797a10cd2be9072d6c43a | 661 | py | Python | python/ray/experimental/workflow/tests/test_large_intermediate.py | zuston/ray | 992437eafe634728390e0d24e39335ee79cbff8f | [
"Apache-2.0"
] | 39 | 2021-02-02T23:09:31.000Z | 2022-03-28T16:39:12.000Z | python/ray/experimental/workflow/tests/test_large_intermediate.py | zuston/ray | 992437eafe634728390e0d24e39335ee79cbff8f | [
"Apache-2.0"
] | 70 | 2021-07-10T07:05:24.000Z | 2022-03-26T07:05:20.000Z | python/ray/experimental/workflow/tests/test_large_intermediate.py | kira-lin/ray | 7802ff66d4346bf8cc39c060b2b78e223edce800 | [
"Apache-2.0"
] | 20 | 2021-02-05T05:51:39.000Z | 2022-03-04T21:13:24.000Z | import time
import numpy as np
from ray.experimental import workflow
@workflow.step
def large_input():
return np.arange(2**24)
@workflow.step
def identity(x):
return x
@workflow.step
def average(x):
return np.mean(x)
@workflow.step
def simple_large_intermediate():
x = large_input.step()
y =... | 16.525 | 60 | 0.685325 |
227de12b892fb145f7f04044b698a40c8bd7a861 | 2,880 | py | Python | qt/CurrencyChart.py | BradleyCSO/university-thesis | 644129f3fdeedf76516974acabec6007d123ee95 | [
"MIT"
] | null | null | null | qt/CurrencyChart.py | BradleyCSO/university-thesis | 644129f3fdeedf76516974acabec6007d123ee95 | [
"MIT"
] | null | null | null | qt/CurrencyChart.py | BradleyCSO/university-thesis | 644129f3fdeedf76516974acabec6007d123ee95 | [
"MIT"
] | null | null | null | from datetime import datetime
from PyQt5.QtCore import Qt
from PyQt5.QtChart import QChart, QCandlestickSeries, QCandlestickSet
from PyQt5.QtGui import QColor
from core import AppCore
class CurrencyChart(QChart):
"""
Chart which can display information about
a currency over a period of time
"""
c... | 28.8 | 69 | 0.589236 |
938aae3a0fb643c25c532ff95c7ebc7ada549dca | 14,542 | py | Python | run_map.py | mbolotis/greekfireprediction.github.io | 1d44eece6df66c78ace32794c0dc40050c10beab | [
"Apache-2.0"
] | 1 | 2021-11-14T08:10:40.000Z | 2021-11-14T08:10:40.000Z | run_map.py | mbolotis/greekfireprediction.github.io | 1d44eece6df66c78ace32794c0dc40050c10beab | [
"Apache-2.0"
] | null | null | null | run_map.py | mbolotis/greekfireprediction.github.io | 1d44eece6df66c78ace32794c0dc40050c10beab | [
"Apache-2.0"
] | null | null | null | from bs4 import BeautifulSoup
import requests
import folium
import json
import os
import time
import pickle
import branca
from tensorflow.keras.models import load_model
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
# Create your views here.
def home():
city = ['AGRINION',
'ALIARTOS',
'ANDRAVID... | 47.061489 | 144 | 0.652661 |
0a41f35d3ba35ef5197a5b59acc0186999b06ea9 | 1,027 | py | Python | src/python_corrector/q1tests.py | pliu/AutomatedCorrector | 2f289f9cf7834134245e5145722dacd47e2f5c37 | [
"Apache-2.0"
] | null | null | null | src/python_corrector/q1tests.py | pliu/AutomatedCorrector | 2f289f9cf7834134245e5145722dacd47e2f5c37 | [
"Apache-2.0"
] | null | null | null | src/python_corrector/q1tests.py | pliu/AutomatedCorrector | 2f289f9cf7834134245e5145722dacd47e2f5c37 | [
"Apache-2.0"
] | null | null | null | from test_runner import *
from random import randint
import sys
class_name = 'Fibonacci'
def all_tests(c):
base_test(c)
correctness_test(c)
recursion_depth_test(c)
single_timeout_test(c)
multi_timeout_test(c)
@test()
def base_test(c):
f = c()
check = f.get_nth_fibonacci(1)
if check ... | 17.706897 | 91 | 0.648491 |
b09f0cb421ad8ab5527b0a5f6822b5539aa8cb8d | 5,065 | py | Python | Grafico cs .py | Git-apc-e-sports/Trabalho | 2d0673696933a16e17b1712ab5419fb5a5724ac4 | [
"MIT"
] | null | null | null | Grafico cs .py | Git-apc-e-sports/Trabalho | 2d0673696933a16e17b1712ab5419fb5a5724ac4 | [
"MIT"
] | null | null | null | Grafico cs .py | Git-apc-e-sports/Trabalho | 2d0673696933a16e17b1712ab5419fb5a5724ac4 | [
"MIT"
] | null | null | null | #Grafico CS
import pandas as pd
import plotly.graph_objects as go
from dash import Dash, html, dcc, Input, Output
#implantação do dash
app = Dash(__name__)
#criacao de grafico
fig1 = go.Figure()
#leitura dos dados da data base
df=pd.read_excel(r'Definitivo.xlsx')
df.dropna(inplace=True) ... | 31.07362 | 121 | 0.559131 |
a89453ae4a2a4051042afc5aa561a527e11c5007 | 5,370 | py | Python | karaoke-maker/backend/vocalremover/vocalremover.py | MorsCerta-crypto/KaraokeMaker | 9784daa5595ba675ead83caf3bc94d2d14421495 | [
"MIT"
] | null | null | null | karaoke-maker/backend/vocalremover/vocalremover.py | MorsCerta-crypto/KaraokeMaker | 9784daa5595ba675ead83caf3bc94d2d14421495 | [
"MIT"
] | null | null | null | karaoke-maker/backend/vocalremover/vocalremover.py | MorsCerta-crypto/KaraokeMaker | 9784daa5595ba675ead83caf3bc94d2d14421495 | [
"MIT"
] | null | null | null | import os
import librosa
import numpy as np
import soundfile as sf
import torch
import tqdm
from threading import Thread
from backend.vocalremover import nets, utils
class VocalRemover(Thread):
def __init__(self,config:dict,file:str):
super().__init__()
device = torch.device("cpu")
self.mo... | 34.87013 | 98 | 0.584171 |
2b705114bdb8f14d9268d08986c42776eb29ec6e | 4,425 | py | Python | tests/adhoc/test_anything.py | kianku/selene | 5361938e4f34d6cfae6df3aeca80e06a3e657d8c | [
"MIT"
] | null | null | null | tests/adhoc/test_anything.py | kianku/selene | 5361938e4f34d6cfae6df3aeca80e06a3e657d8c | [
"MIT"
] | null | null | null | tests/adhoc/test_anything.py | kianku/selene | 5361938e4f34d6cfae6df3aeca80e06a3e657d8c | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2015-2019 Iakiv Kramarenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modif... | 43.811881 | 103 | 0.687006 |
a02fd6fd1826dcc201251502c37a2b960f8c5163 | 472 | py | Python | rest/subaccounts/listing-subaccounts-example-2/listing-subaccounts-example-2.6.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | 3 | 2020-05-05T10:01:02.000Z | 2021-02-06T14:23:13.000Z | rest/subaccounts/listing-subaccounts-example-2/listing-subaccounts-example-2.6.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | null | null | null | rest/subaccounts/listing-subaccounts-example-2/listing-subaccounts-example-2.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)
# A list of account objects... | 31.466667 | 72 | 0.805085 |
365f50da22b5b34b846dc58b5a008d21205c719e | 10,555 | py | Python | modelscript/metamodels/classes/associations.py | ScribesZone/ModelScribes | a36be1047283f2e470dc2dd4353f2a714377bb7d | [
"MIT"
] | 1 | 2019-02-22T14:27:06.000Z | 2019-02-22T14:27:06.000Z | modelscript/metamodels/classes/associations.py | ScribesZone/ModelScribes | a36be1047283f2e470dc2dd4353f2a714377bb7d | [
"MIT"
] | 4 | 2015-12-18T10:30:02.000Z | 2015-12-18T10:36:28.000Z | modelscript/metamodels/classes/associations.py | ScribesZone/ModelScribes | a36be1047283f2e470dc2dd4353f2a714377bb7d | [
"MIT"
] | null | null | null | # coding=utf-8
"""Definition of associations.
Defines the following metaclasses:
* Association,
* PlainAssociation,
* Role.
"""
import abc
import collections
from typing import Optional, Text, Dict, Union, List
from typing_extensions import Literal
from modelscript.megamodels.elements import (
SourceModelElement)... | 28.373656 | 120 | 0.577451 |
0892e86f558a456423015148c42c5abd273ce09e | 9,076 | py | Python | light9/collector/device.py | drewp/light9 | ab173a40d095051546e532962f7a33ac502943a6 | [
"MIT"
] | 2 | 2018-10-05T13:32:46.000Z | 2022-01-01T22:51:20.000Z | light9/collector/device.py | drewp/light9 | ab173a40d095051546e532962f7a33ac502943a6 | [
"MIT"
] | 4 | 2021-06-08T19:33:40.000Z | 2022-03-11T23:18:06.000Z | light9/collector/device.py | drewp/light9 | ab173a40d095051546e532962f7a33ac502943a6 | [
"MIT"
] | null | null | null | import logging
from typing import Dict, List, Any
from light9.namespaces import L9
from rdflib import Literal, URIRef
from webcolors import hex_to_rgb, rgb_to_hex
from colormath.color_objects import sRGBColor, CMYColor
import colormath.color_conversions
from light9.newtypes import OutputAttr, OutputValue, DeviceUri, De... | 33.124088 | 112 | 0.530079 |
30a579fd574ca727a753b358bd5b8a9f152b1477 | 1,883 | py | Python | Tasker_backend/backendapi.py | mihainsto/AndroidApps | 2bd75a672a549a192d6ce7adb26cdcb24bad5ff3 | [
"MIT"
] | null | null | null | Tasker_backend/backendapi.py | mihainsto/AndroidApps | 2bd75a672a549a192d6ce7adb26cdcb24bad5ff3 | [
"MIT"
] | null | null | null | Tasker_backend/backendapi.py | mihainsto/AndroidApps | 2bd75a672a549a192d6ce7adb26cdcb24bad5ff3 | [
"MIT"
] | null | null | null | from flask import Flask, jsonify, request
app = Flask(__name__)
def addUserDB(username, password):
with open('users.txt','a') as f:
f.write(username)
f.write('\n')
f.write(password)
f.write('\n')
def verifyUserDB(username, password):
with open('users.txt','r') as f:
li... | 28.969231 | 76 | 0.590016 |
48d17a6d03b60d5f0b3138a0fad34c776a280cfa | 2,322 | py | Python | weather_app.py | lukexyz/prodb | 84dd4f878a3f4140ac4672f64e6da95b964d09d8 | [
"Apache-2.0"
] | 4 | 2021-09-12T11:51:38.000Z | 2021-10-01T11:59:31.000Z | weather_app.py | lukexyz/prodb | 84dd4f878a3f4140ac4672f64e6da95b964d09d8 | [
"Apache-2.0"
] | 1 | 2021-11-15T15:02:14.000Z | 2021-11-15T15:02:14.000Z | weather_app.py | lukexyz/prodb | 84dd4f878a3f4140ac4672f64e6da95b964d09d8 | [
"Apache-2.0"
] | null | null | null | import os.path; import requests; import json; import random
import pandas as pd; import numpy as np; import arrow
from PIL import Image
import streamlit as st
from prodb.core import generate_db, insert_row, utc_now, readable_df
from prodb.examples import visit_city
def main():
t1, t2 = st.columns... | 37.451613 | 114 | 0.587425 |
187058411fbfc3966f01ccd93779f5a7c08e24f8 | 13,476 | py | Python | lib/cuckoo/common/utils.py | xuna123/Bold-Falcon | bef7dfc3103143bd51ca82838565877097fecc49 | [
"BSD-3-Clause"
] | 1 | 2021-06-22T05:33:08.000Z | 2021-06-22T05:33:08.000Z | lib/cuckoo/common/utils.py | xuna123/Bold-Falcon | bef7dfc3103143bd51ca82838565877097fecc49 | [
"BSD-3-Clause"
] | null | null | null | lib/cuckoo/common/utils.py | xuna123/Bold-Falcon | bef7dfc3103143bd51ca82838565877097fecc49 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2010-2013 Claudio Guarnieri.
# Copyright (C) 2014-2016 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import hashlib
import logging
import os
import sys
import shutil
import ntpath
import string
import tempfi... | 30.627273 | 99 | 0.640843 |
512ee98c1c26c58b9f23014fd2732599fd3270af | 3,909 | py | Python | tests/contracts/auctions/test_simple_open_auction.py | ltfschoen/vyper-test | 72695b211733748351e1ac88ab4619457391729b | [
"MIT"
] | 8 | 2018-04-26T16:51:29.000Z | 2021-08-11T22:12:15.000Z | tests/contracts/auctions/test_simple_open_auction.py | ltfschoen/vyper-test | 72695b211733748351e1ac88ab4619457391729b | [
"MIT"
] | 2 | 2018-04-19T04:09:30.000Z | 2021-06-01T22:09:48.000Z | tests/contracts/auctions/test_simple_open_auction.py | ltfschoen/vyper-test | 72695b211733748351e1ac88ab4619457391729b | [
"MIT"
] | 2 | 2020-09-10T08:56:53.000Z | 2020-12-13T00:06:21.000Z | import pytest
import ethereum.utils as utils
FIVE_DAYS = 432000
@pytest.fixture
def auction_tester(t):
from vyper import compiler
t.languages['vyper'] = compiler.Compiler()
contract_code = open('contracts/auctions/simple_open_auction.v.py').read()
t.c = t.s.contract(contract_code, language='vyper', ar... | 51.434211 | 102 | 0.761832 |
0ab4f6c1febdf57e8a63bef875fbcea9a3f4f27d | 3,081 | py | Python | flaskblog/forms.py | igormaraujo/simple-flask-blog | daeb0f04568d6795971ef4a9405e7e8c4a2637fa | [
"MIT"
] | null | null | null | flaskblog/forms.py | igormaraujo/simple-flask-blog | daeb0f04568d6795971ef4a9405e7e8c4a2637fa | [
"MIT"
] | null | null | null | flaskblog/forms.py | igormaraujo/simple-flask-blog | daeb0f04568d6795971ef4a9405e7e8c4a2637fa | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileAllowed
from flask_login import current_user
# Add HiddenField import
from wtforms import StringField, PasswordField, SubmitField, BooleanField, TextAreaField, RadioField, HiddenField
from wtforms.validators import DataRequired, Length, Email, Eq... | 42.791667 | 153 | 0.667316 |
ca4e7e51ac309fa003574bbd10b313ab1c79e92c | 1,245 | py | Python | app/redirectproxy.py | arkarkark/snippy | 66a3e5442085e27853ac7f6e3064c53fa364cc18 | [
"MIT"
] | null | null | null | app/redirectproxy.py | arkarkark/snippy | 66a3e5442085e27853ac7f6e3064c53fa364cc18 | [
"MIT"
] | 23 | 2015-11-13T18:40:55.000Z | 2022-02-10T18:15:56.000Z | app/redirectproxy.py | arkarkark/snippy | 66a3e5442085e27853ac7f6e3064c53fa364cc18 | [
"MIT"
] | null | null | null | # Copyright 2009 Alex K (wtwf.com) All rights reserved.
__author__ = 'wtwf.com (Alex K)'
import os
import urllib
import urllib2
from wtwf import wtwfhandler
PROXY_IMAGE_EXTENSIONS = ['.gif', '.png', '.jpg', '.jpeg']
REDIRECT_NORMALLY_EXTENSIONS = ['.xml', '.pdf']
class RedirectProxyHandler(wtwfhandler.WtwfHandler)... | 28.953488 | 60 | 0.641767 |
b20787c81fe37cc0eec6fc9ac3fc427401e09d05 | 1,620 | py | Python | ejemplos/integracion/python/archivos.py | mcd-unison/ing-caract | 9c9c3359df22b62de28cc2aca2feb815af81c015 | [
"MIT"
] | 2 | 2021-08-25T00:28:45.000Z | 2021-10-31T02:21:57.000Z | ejemplos/integracion/python/archivos.py | mcd-unison/ing-caract | 9c9c3359df22b62de28cc2aca2feb815af81c015 | [
"MIT"
] | null | null | null | ejemplos/integracion/python/archivos.py | mcd-unison/ing-caract | 9c9c3359df22b62de28cc2aca2feb815af81c015 | [
"MIT"
] | 4 | 2021-08-16T20:36:34.000Z | 2021-12-10T08:33:31.000Z | # Carga archivos desde internet (muchas formas de hacerlo)
import os # Para manejo de archivos y directorios
import urllib # Una forma estandard de descargar datos
# import requests # Otra forma no de las librerías de uso comun
import datetime # Fecha de descarga
import pandas as pd # Solo para ver el archivo descar... | 45 | 118 | 0.716667 |
5b4904b019de86a47ec7f7eb752547a58e49c6f6 | 132 | py | Python | rental/forms.py | ledomone/kurs_django | c24aaf8f8a22a695b41e2436bf9bf4d1ca665079 | [
"MIT"
] | null | null | null | rental/forms.py | ledomone/kurs_django | c24aaf8f8a22a695b41e2436bf9bf4d1ca665079 | [
"MIT"
] | null | null | null | rental/forms.py | ledomone/kurs_django | c24aaf8f8a22a695b41e2436bf9bf4d1ca665079 | [
"MIT"
] | null | null | null | from django import forms
from .models import Rental
class BookRentForm(forms.ModelForm):
class Meta:
model = Rental
| 13.2 | 36 | 0.712121 |
f2aa7116b432c764d302b19f1a87f1ff493478fb | 313 | py | Python | ML2-Unsupervised-Learning/ML2.1-Clustering/ct1_clustering_2d_points.py | ridhanf/machine-learning-datacamp | 2c2c0f5dfcf9df315488cdef8eabd1d4f9fbd0e8 | [
"MIT"
] | null | null | null | ML2-Unsupervised-Learning/ML2.1-Clustering/ct1_clustering_2d_points.py | ridhanf/machine-learning-datacamp | 2c2c0f5dfcf9df315488cdef8eabd1d4f9fbd0e8 | [
"MIT"
] | null | null | null | ML2-Unsupervised-Learning/ML2.1-Clustering/ct1_clustering_2d_points.py | ridhanf/machine-learning-datacamp | 2c2c0f5dfcf9df315488cdef8eabd1d4f9fbd0e8 | [
"MIT"
] | null | null | null | # Import KMeans
from sklearn.cluster import KMeans
# Create a KMeans instance with 3 clusters: model
model = KMeans(n_clusters=3)
# Fit model to points
model.fit(points)
# Determine the cluster labels of new_points: labels
labels = model.predict(new_points)
# Print cluster labels of new_points
print(labels)
| 20.866667 | 52 | 0.782748 |
b145ddb94c53350eafd35b5d3ac6e214ccc7e2bb | 10,825 | py | Python | Jessica/DaPr.py | xiayanzheng/LF.Comlib | bccbf02d3e60079475876f7514166702470489d2 | [
"MIT"
] | null | null | null | Jessica/DaPr.py | xiayanzheng/LF.Comlib | bccbf02d3e60079475876f7514166702470489d2 | [
"MIT"
] | 5 | 2019-05-07T07:34:05.000Z | 2022-03-21T22:17:32.000Z | Jessica/DaPr.py | xiayanzheng/lfcomlib | bccbf02d3e60079475876f7514166702470489d2 | [
"MIT"
] | null | null | null | import datetime
import os
import re
import time
from functools import reduce
import prettytable
class Dict(dict):
__setattr__ = dict.__setitem__
__getattr__ = dict.__getitem__
class Core(object):
@staticmethod
def show_selection_table(selection_list, table_head, question_text):
pt = pretty... | 30.928571 | 113 | 0.55067 |
03cbd7452f9ee1ad6dda1c99f0895ea6f17ba766 | 17,671 | py | Python | cqlengine/tests/columns/test_container_columns.py | jfelectron/cqlengine | 34a121aeebfb1ab6954b08a664eeba53d6c122ba | [
"BSD-3-Clause"
] | null | null | null | cqlengine/tests/columns/test_container_columns.py | jfelectron/cqlengine | 34a121aeebfb1ab6954b08a664eeba53d6c122ba | [
"BSD-3-Clause"
] | null | null | null | cqlengine/tests/columns/test_container_columns.py | jfelectron/cqlengine | 34a121aeebfb1ab6954b08a664eeba53d6c122ba | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime, timedelta
import json
from uuid import uuid4
import six
from cqlengine import Model, ValidationError
from cqlengine import columns
from cqlengine.management import sync_table, drop_table
from cqlengine.tests.base import BaseCassEngTestCase
class TestSetModel(Model):
__keyspace__ = ... | 33.153846 | 93 | 0.637542 |
4101116ab41b9f88a6b576a830d7154117024d9c | 509 | py | Python | src/modes/proportional.py | sr-lab/pyrrho | 8e05101d6bea97872bf8386ff1aa4a86e259ffd1 | [
"MIT"
] | null | null | null | src/modes/proportional.py | sr-lab/pyrrho | 8e05101d6bea97872bf8386ff1aa4a86e259ffd1 | [
"MIT"
] | null | null | null | src/modes/proportional.py | sr-lab/pyrrho | 8e05101d6bea97872bf8386ff1aa4a86e259ffd1 | [
"MIT"
] | null | null | null | import pandas as pd
def reselect (total, surplus, df):
""" Models proportional reselection on a password probability distribution.
Args:
total (float): The total probability (should be approximately equal to 1).
surplus (float): The surplus probability (should be less than or equal to `total`... | 31.8125 | 91 | 0.679764 |
bbba38dfbbba7c1f7d879a781987bb4aa6e9e52f | 4,240 | py | Python | tests/test_residue_index.py | PDBe-KB/funpdbe-validator | f89030a2cf9c5fd626b4acbf6440ae38bd0e51a1 | [
"Apache-2.0"
] | null | null | null | tests/test_residue_index.py | PDBe-KB/funpdbe-validator | f89030a2cf9c5fd626b4acbf6440ae38bd0e51a1 | [
"Apache-2.0"
] | null | null | null | tests/test_residue_index.py | PDBe-KB/funpdbe-validator | f89030a2cf9c5fd626b4acbf6440ae38bd0e51a1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""
Copyright 2018 EMBL - European Bioinformatics Institute
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... | 37.857143 | 114 | 0.675236 |
53403ed3110f4a5f705190fb154cd4a04de59bb0 | 1,565 | py | Python | infra/__main__.py | Avanade/emtech-stretch-labs | df5dcaa53cc2dd1d59ba953e4b4c3968b11ec97f | [
"MIT"
] | 3 | 2021-05-12T06:53:35.000Z | 2021-11-17T10:03:16.000Z | infra/__main__.py | Avanade/emtech-stretch-labs | df5dcaa53cc2dd1d59ba953e4b4c3968b11ec97f | [
"MIT"
] | 32 | 2021-04-23T11:42:27.000Z | 2021-07-12T15:10:46.000Z | infra/__main__.py | Avanade/emtech-stretch-labs | df5dcaa53cc2dd1d59ba953e4b4c3968b11ec97f | [
"MIT"
] | null | null | null | """Set up the stretch labs"""
import pulumi
from pulumi_azure_native import storage
from pulumi_azure_native import resources
import pulumi_azure_native.web as web
# get compliance configuration
project_compliance_config = pulumi.Config("project-compliance")
rg_purpose = project_compliance_config.require("rg-purpose"... | 25.241935 | 83 | 0.739297 |
0b6ac97a40ccc772e41be3329491921dc3505e9f | 32,027 | py | Python | npyscreen/wgmultiline.py | tbabej/npyscreen | 89f5998ec9a04678bcce56489bba6411456417fc | [
"BSD-2-Clause"
] | null | null | null | npyscreen/wgmultiline.py | tbabej/npyscreen | 89f5998ec9a04678bcce56489bba6411456417fc | [
"BSD-2-Clause"
] | null | null | null | npyscreen/wgmultiline.py | tbabej/npyscreen | 89f5998ec9a04678bcce56489bba6411456417fc | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
import copy
from . import wgwidget as widget
from . import wgtextbox as textbox
import textwrap
import curses
from . import wgtitlefield as titlefield
from . import fmPopup as Popup
import weakref
import collections
import copy
MORE_LABEL = "-more-" # string to tell user there are... | 37.068287 | 150 | 0.575639 |
1884505c4547ed93364ebeb3491600f3fa6f6311 | 2,805 | py | Python | tests/test_links_spider.py | bidhive/kingfisher-collect | 100d91e9f388ab9eab62217ff2b1a86a8e81c3f7 | [
"BSD-3-Clause"
] | null | null | null | tests/test_links_spider.py | bidhive/kingfisher-collect | 100d91e9f388ab9eab62217ff2b1a86a8e81c3f7 | [
"BSD-3-Clause"
] | null | null | null | tests/test_links_spider.py | bidhive/kingfisher-collect | 100d91e9f388ab9eab62217ff2b1a86a8e81c3f7 | [
"BSD-3-Clause"
] | null | null | null | from datetime import date
import pytest
from scrapy.http import Request
from scrapy.utils.trackref import NoneType
from kingfisher_scrapy.base_spider import LinksSpider
from kingfisher_scrapy.exceptions import MissingNextLinkError
from kingfisher_scrapy.items import File, FileError
from tests import response_fixture,... | 31.166667 | 114 | 0.683422 |
437afd419d28e020239d4685cc82a6772fe8baad | 1,239 | py | Python | Server/tests/v2/views/student/account/t_auth.py | moreal/DMS-Backend | c0a3b28972739c58049a296570bb873f32c03eec | [
"MIT"
] | 27 | 2018-01-14T08:07:18.000Z | 2020-01-20T14:21:17.000Z | Server/tests/v2/views/student/account/t_auth.py | moreal/DMS-Backend | c0a3b28972739c58049a296570bb873f32c03eec | [
"MIT"
] | 50 | 2018-02-12T12:51:33.000Z | 2018-08-28T00:48:31.000Z | Server/tests/v2/views/student/account/t_auth.py | moreal/DMS-Backend | c0a3b28972739c58049a296570bb873f32c03eec | [
"MIT"
] | 10 | 2018-03-31T16:30:32.000Z | 2021-03-02T10:30:31.000Z | from tests.v2.views import TCBase
class TestStudentAccountAuth(TCBase):
"""
학생 계정 로그인을 테스트 합니다.
"""
def __init__(self, *args, **kwargs):
super(TestStudentAccountAuth, self).__init__(*args, **kwargs)
self.method = self.client.post
self.target_uri = '/student/auth'
def setU... | 24.294118 | 79 | 0.561743 |
1e6b70792b04bef377591a74de96f3f59cd88dd5 | 307 | py | Python | hackerrank/itertools_product.py | FelixTheC/hackerrank_exercises | 24eedbedebd122c53fd2cb6018cc3535d0d4c6a0 | [
"MIT"
] | null | null | null | hackerrank/itertools_product.py | FelixTheC/hackerrank_exercises | 24eedbedebd122c53fd2cb6018cc3535d0d4c6a0 | [
"MIT"
] | null | null | null | hackerrank/itertools_product.py | FelixTheC/hackerrank_exercises | 24eedbedebd122c53fd2cb6018cc3535d0d4c6a0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@created: 10.11.19
@author: felix
"""
from itertools import product
if __name__ == '__main__':
a = [int(i) for i in input().strip().split()]
b = [int(i) for i in input().strip().split()]
print(' '.join([f'{prod}' for prod in product(a, b)]))
| 21.928571 | 58 | 0.579805 |
c54c150d805f3ccf8705b3a2482c367f6e5ad3d1 | 2,268 | py | Python | examples/example_events_listener.py | Th0rgal/binance.py | 9e21993d9ac3211b8a17b0d4b479ce94237875e4 | [
"MIT"
] | 61 | 2020-06-23T13:58:19.000Z | 2022-01-26T16:25:47.000Z | examples/example_events_listener.py | Th0rgal/binance.py | 9e21993d9ac3211b8a17b0d4b479ce94237875e4 | [
"MIT"
] | 25 | 2020-06-23T07:53:46.000Z | 2022-01-08T19:15:14.000Z | examples/example_events_listener.py | Th0rgal/binance.py | 9e21993d9ac3211b8a17b0d4b479ce94237875e4 | [
"MIT"
] | 20 | 2020-06-23T07:50:19.000Z | 2022-02-09T09:09:44.000Z | import os, sys, toml, shutil, asyncio
# to import binance.py from the dev directory, you can actually remove this line
# if you just want to start your bot from this base
sys.path.append("../")
import binance
class Config:
def __init__(self, file_name, template_name):
config_file = self.extract_config(fi... | 36 | 153 | 0.704145 |
26b1d1499f212752dd1930808933013ac69735ab | 11,263 | py | Python | twilio/rest/wireless/v1/sim/data_session.py | neetaramaswamy/twilio-python | 28472ffab1a170824ba17f12a6c1692a5e849439 | [
"MIT"
] | 30 | 2018-06-12T12:00:53.000Z | 2021-05-02T01:27:16.000Z | venv/lib/python3.6/site-packages/twilio/rest/wireless/v1/sim/data_session.py | ostar0816/mc-crypto | 80ad9896aed1dc952f819a404a458ccfad207d8e | [
"MIT"
] | 10 | 2020-06-06T01:10:07.000Z | 2022-03-12T00:12:22.000Z | venv/lib/python3.6/site-packages/twilio/rest/wireless/v1/sim/data_session.py | ostar0816/mc-crypto | 80ad9896aed1dc952f819a404a458ccfad207d8e | [
"MIT"
] | 4 | 2018-06-12T14:14:20.000Z | 2018-06-19T16:01:49.000Z | # coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import Li... | 32.458213 | 95 | 0.616266 |
2df0b18662a4b68a36f2550519981a9b1644175c | 3,837 | py | Python | tests/test_data.py | kiwicom/pg2avro | 51c309de90cf3d9bb71c7744c98b87de5c3393e6 | [
"MIT"
] | 11 | 2020-02-12T01:05:56.000Z | 2022-03-24T06:58:49.000Z | tests/test_data.py | kiwicom/pg2avro | 51c309de90cf3d9bb71c7744c98b87de5c3393e6 | [
"MIT"
] | 4 | 2019-07-30T12:29:42.000Z | 2020-04-16T13:28:38.000Z | tests/test_data.py | kiwicom/pg2avro | 51c309de90cf3d9bb71c7744c98b87de5c3393e6 | [
"MIT"
] | 1 | 2020-09-04T19:51:39.000Z | 2020-09-04T19:51:39.000Z | from collections import OrderedDict
from typing import List
from pg2avro import get_avro_schema, get_avro_row_dict
import json
def test_get_avro_row_row_types():
"""
Test generating Avro rows from different source row data.
TODO: Cover more than the simplest golden path.
"""
columns = [
{... | 28.213235 | 88 | 0.473286 |
a07bf73f8c69fd5e0417933f77c17fb8dcf02376 | 5,094 | py | Python | Chapter_11/BankSubscriberPreprocess.py | dineshpackt/Hands-on-Artificial-Intelligence-with-TensorFlow-Book | a06430b44d115e7c38862f4dded83ad36a5f632c | [
"MIT"
] | null | null | null | Chapter_11/BankSubscriberPreprocess.py | dineshpackt/Hands-on-Artificial-Intelligence-with-TensorFlow-Book | a06430b44d115e7c38862f4dded83ad36a5f632c | [
"MIT"
] | null | null | null | Chapter_11/BankSubscriberPreprocess.py | dineshpackt/Hands-on-Artificial-Intelligence-with-TensorFlow-Book | a06430b44d115e7c38862f4dded83ad36a5f632c | [
"MIT"
] | null | null | null | '''
Created on 09-Jul-2018
@author: Ankit Dixit
'''
# We will use pandas for creating data frames
from sklearn.preprocessing import LabelEncoder
import pandas as pd
# scikit learn will help us in normalizing our data set
# Let's start with loading our data from csv file
data = pd.read_csv('bank-addi... | 34.187919 | 97 | 0.638202 |
75402019efff7a8a2a5ff7b6f6754a1e2b42f6ca | 389 | py | Python | sender/sender/wsgi.py | hanjak/news_notificator | 53fc81b8b2e5985fa5ce2449fa99168f21f0398c | [
"MIT"
] | null | null | null | sender/sender/wsgi.py | hanjak/news_notificator | 53fc81b8b2e5985fa5ce2449fa99168f21f0398c | [
"MIT"
] | null | null | null | sender/sender/wsgi.py | hanjak/news_notificator | 53fc81b8b2e5985fa5ce2449fa99168f21f0398c | [
"MIT"
] | null | null | null | """
WSGI config for sender project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTIN... | 22.882353 | 78 | 0.784062 |
c4000f0d3281860d1d0818e661ec148e7e8143f9 | 69 | py | Python | task/string ex.1.py | dhaneeshgk/share_food | ee7549377abe0c6a47d88931226c3ba29a706c42 | [
"MIT"
] | 1 | 2018-05-30T11:42:26.000Z | 2018-05-30T11:42:26.000Z | task/string ex.1.py | dhaneeshgk/share_food | ee7549377abe0c6a47d88931226c3ba29a706c42 | [
"MIT"
] | null | null | null | task/string ex.1.py | dhaneeshgk/share_food | ee7549377abe0c6a47d88931226c3ba29a706c42 | [
"MIT"
] | null | null | null | my_string ="Hello!"
print (len(my_string))
print (my_string.upper())
| 17.25 | 25 | 0.724638 |
3f55864583f4d27df98cbf1c779ecbef48f7b8f6 | 349 | py | Python | marker.py | CookieStudios5609/BookMarkR-Discord | 160bf9464530c7dc1d6f05a2453644a1cdeb4079 | [
"MIT"
] | null | null | null | marker.py | CookieStudios5609/BookMarkR-Discord | 160bf9464530c7dc1d6f05a2453644a1cdeb4079 | [
"MIT"
] | null | null | null | marker.py | CookieStudios5609/BookMarkR-Discord | 160bf9464530c7dc1d6f05a2453644a1cdeb4079 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
class Marker(commands.Cog):
def __init__(self, bm):
self.bm = bm
@commands.command(name="bookmark", help="Bookmarks a message", aliases=["bm", "mark", "save"])
async def bookmark(self, ctx, message):
to_mark = message.content
... | 26.846154 | 99 | 0.636103 |
d3a885b2d10b615a94740241df06358827f9fbb7 | 1,081 | py | Python | labmanager/babel.py | morelab/labmanager | b44f97f26f224e4a94c7981e5cc84f3b5c8cc440 | [
"BSD-2-Clause"
] | 2 | 2015-11-05T01:43:19.000Z | 2017-10-19T15:28:53.000Z | labmanager/babel.py | morelab/labmanager | b44f97f26f224e4a94c7981e5cc84f3b5c8cc440 | [
"BSD-2-Clause"
] | 3 | 2021-03-22T17:12:12.000Z | 2021-12-13T19:39:20.000Z | labmanager/babel.py | morelab/labmanager | b44f97f26f224e4a94c7981e5cc84f3b5c8cc440 | [
"BSD-2-Clause"
] | 6 | 2016-03-08T09:32:16.000Z | 2022-01-06T09:53:37.000Z | import traceback
try:
USE_BABELEX = True
if USE_BABELEX:
# Use regular Babelex instead of Babel
from flask.ext.babelex import Babel as Babel_ex, gettext as gettext_ex, lazy_gettext as lazy_gettext_ex, ngettext as ngettext_ex
gettext = gettext_ex
ngettext = ngettext_ex
... | 27.025 | 138 | 0.673451 |
d4ffd8b6f37e21437dc82f035f0916ec12461311 | 9,703 | py | Python | ceilometer/agent/plugin_base.py | mail2nsrajesh/ceilometer | f53ab18125cc2efc9a9d492a9c1e4acbc2e28d90 | [
"Apache-2.0"
] | null | null | null | ceilometer/agent/plugin_base.py | mail2nsrajesh/ceilometer | f53ab18125cc2efc9a9d492a9c1e4acbc2e28d90 | [
"Apache-2.0"
] | null | null | null | ceilometer/agent/plugin_base.py | mail2nsrajesh/ceilometer | f53ab18125cc2efc9a9d492a9c1e4acbc2e28d90 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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... | 35.028881 | 79 | 0.673091 |
4c16a623dad5a35411b11f7384d3b0a50a8fe586 | 3,251 | py | Python | src/stewart/stewart_ik.py | asmorgan24/stewart | 7bb5225f4b8d719f184d57897e7cdbe4337cea6c | [
"MIT"
] | 1 | 2021-07-27T19:25:31.000Z | 2021-07-27T19:25:31.000Z | src/stewart/stewart_ik.py | asmorgan24/stewart | 7bb5225f4b8d719f184d57897e7cdbe4337cea6c | [
"MIT"
] | null | null | null | src/stewart/stewart_ik.py | asmorgan24/stewart | 7bb5225f4b8d719f184d57897e7cdbe4337cea6c | [
"MIT"
] | null | null | null | #! /usr/bin/python
import rospy, rospkg, math
import numpy as np
import IPython
from std_msgs.msg import Float32MultiArray
from geometry_msgs.msg import Twist
from std_msgs.msg import Int32
class stewart_ik():
def __init__(self):
self.MUL = 1
self.height = 2.0 *self.MUL
self.b = [[-0... | 35.725275 | 150 | 0.500154 |
c786b25856df382c5ef6647883bd1eb24d6dd1b5 | 1,722 | py | Python | Ch15/s15_06/ui_vboxlayout.py | Deteriorator/PyQt5-Guide | d34a9659894d279b17369528359844a4ae4aeb20 | [
"CC0-1.0"
] | 1 | 2022-02-23T09:58:11.000Z | 2022-02-23T09:58:11.000Z | Ch15/s15_06/ui_vboxlayout.py | Deteriorator/PyQt5-Guide | d34a9659894d279b17369528359844a4ae4aeb20 | [
"CC0-1.0"
] | null | null | null | Ch15/s15_06/ui_vboxlayout.py | Deteriorator/PyQt5-Guide | d34a9659894d279b17369528359844a4ae4aeb20 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'vboxlayout.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_DialogVBox(object):
def setupUi(self, Dialog):
Dialog.set... | 42 | 78 | 0.713124 |
5ba1999ecc240dce1aea070144844409e3ae2230 | 4,936 | py | Python | test.py | easthorse/brain-tumor-segmentation-based-on-group-convolution | 98547a4c89cd96c85045e70b46f89cfdb74edfca | [
"OLDAP-2.3"
] | 6 | 2020-08-30T15:48:54.000Z | 2021-04-20T02:46:43.000Z | test.py | easthorse/brain-tumor-segmentation-based-on-group-convolution | 98547a4c89cd96c85045e70b46f89cfdb74edfca | [
"OLDAP-2.3"
] | null | null | null | test.py | easthorse/brain-tumor-segmentation-based-on-group-convolution | 98547a4c89cd96c85045e70b46f89cfdb74edfca | [
"OLDAP-2.3"
] | null | null | null | # coding=utf-8
import argparse
import os
import time
import logging
import random
from data.sampler import CycleSampler
import torch
import pdb
import torch.backends.cudnn as cudnn
import torch.optim
from torch.utils.data import DataLoader
cudnn.benchmark = True
import numpy as np
import models
from data import data... | 33.127517 | 101 | 0.642018 |
b37ad8c15a83e91189c802adf76e0ebdd06626f9 | 13,181 | py | Python | homeassistant/components/rfxtrx/__init__.py | fb22/home-assistant | a95ab9c8099e321a5be0e2d6689258ac9c262636 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/rfxtrx/__init__.py | fb22/home-assistant | a95ab9c8099e321a5be0e2d6689258ac9c262636 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/rfxtrx/__init__.py | fb22/home-assistant | a95ab9c8099e321a5be0e2d6689258ac9c262636 | [
"Apache-2.0"
] | null | null | null | """Support for RFXtrx devices."""
import binascii
from collections import OrderedDict
import logging
import RFXtrx as rfxtrxmod
import voluptuous as vol
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_NAME,
ATTR_STATE,
CONF_DEVICE,
CONF_DEVICES,
CONF_HOST,
CONF_PORT,
EVENT_HOMEA... | 30.025057 | 86 | 0.615204 |
91ab30de06c024cd3a7e640d89422f92722718ce | 3,152 | py | Python | 09_cloudml/call_predict_updated.py | cromann/data-science-on-gcp | 9708531d1c6e0ba590b996f6dab2006f474f2adc | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | 09_cloudml/call_predict_updated.py | cromann/data-science-on-gcp | 9708531d1c6e0ba590b996f6dab2006f474f2adc | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | 09_cloudml/call_predict_updated.py | cromann/data-science-on-gcp | 9708531d1c6e0ba590b996f6dab2006f474f2adc | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import googleapiclient.discovery
import argparse
def predict_json(project, model, instances, version=None):
"""Send json data to a deployed model for prediction.
Args:
project (str): project where the Cloud ML Engine Model is deployed.
model (str): model name.
instances ([Mapping[str: ... | 34.637363 | 144 | 0.629759 |
656367ca8eab370fe1a3a447fe9f87e6d8785680 | 390 | py | Python | python/year2017/day02.py | Dullstar/Advent_Of_Code | 83206a3c258fc557cd2c099fad9876098175a995 | [
"MIT"
] | 1 | 2021-12-13T09:34:04.000Z | 2021-12-13T09:34:04.000Z | python/year2017/day02.py | Dullstar/Advent_Of_Code | 83206a3c258fc557cd2c099fad9876098175a995 | [
"MIT"
] | null | null | null | python/year2017/day02.py | Dullstar/Advent_Of_Code | 83206a3c258fc557cd2c099fad9876098175a995 | [
"MIT"
] | 2 | 2021-12-05T13:50:38.000Z | 2021-12-12T07:45:08.000Z | import time
import os
def main(input_filename: str):
# Generated by generate_files.py on Wed Nov 17 2021
# Return value of -1 is used to signal that this isn't implemented.
# Once it is, remove/replace that return (implicitly returning None is fine).
return -1
if __name__ == "__main__":
os.chdi... | 24.375 | 81 | 0.687179 |
40d8acea54cbc4aeedb8651d343a594f75fd14b0 | 204 | py | Python | adaequare_gsp/adaequare_gsp/doctype/ewaybill_log/ewaybill_log.py | mohsinalimat/adaequare_gsp | e3e8bb282f25dc791cb07cc41e04bc60a7066e07 | [
"MIT"
] | null | null | null | adaequare_gsp/adaequare_gsp/doctype/ewaybill_log/ewaybill_log.py | mohsinalimat/adaequare_gsp | e3e8bb282f25dc791cb07cc41e04bc60a7066e07 | [
"MIT"
] | null | null | null | adaequare_gsp/adaequare_gsp/doctype/ewaybill_log/ewaybill_log.py | mohsinalimat/adaequare_gsp | e3e8bb282f25dc791cb07cc41e04bc60a7066e07 | [
"MIT"
] | null | null | null | # Copyright (c) 2021, Resilient Tech and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class EwaybillLog(Document):
pass
| 20.4 | 53 | 0.779412 |
2bcb2ffa22e53e247288233c26e830eff9250ed1 | 1,540 | py | Python | cac/client/engine/animation.py | tobias93/cards-against-cli | 33c5a43a3b821438c94da719571655d87998384a | [
"MIT"
] | null | null | null | cac/client/engine/animation.py | tobias93/cards-against-cli | 33c5a43a3b821438c94da719571655d87998384a | [
"MIT"
] | null | null | null | cac/client/engine/animation.py | tobias93/cards-against-cli | 33c5a43a3b821438c94da719571655d87998384a | [
"MIT"
] | null | null | null |
class Animation:
"""
"Animates" a value by slowly changing it from
it's current value to it's target value over time.
"""
def __init__(self, value):
"""
:param value: The initial value of the animated value
"""
self.value = value
self._running = False
... | 28.518519 | 74 | 0.569481 |
a98d7260dfc431179f8ee4da773110fab265f51d | 3,052 | py | Python | ethereumetl/streaming/eth_item_id_calculator.py | BitskiCo/ethereum-etl | cee9004444396ec64f4363e12e5d74508c190d26 | [
"MIT"
] | null | null | null | ethereumetl/streaming/eth_item_id_calculator.py | BitskiCo/ethereum-etl | cee9004444396ec64f4363e12e5d74508c190d26 | [
"MIT"
] | null | null | null | ethereumetl/streaming/eth_item_id_calculator.py | BitskiCo/ethereum-etl | cee9004444396ec64f4363e12e5d74508c190d26 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2018 Evgeny Medvedev, evge.medvedev@gmail.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# ... | 50.032787 | 123 | 0.696592 |
cec0053b9f66a32112643423885444b59a24ef0a | 23,421 | py | Python | swift-2.21.0/test/functional/s3api/test_bucket.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | null | null | null | swift-2.21.0/test/functional/s3api/test_bucket.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | swift-2.21.0/test/functional/s3api/test_bucket.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Copyright (c) 2015 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 44.953935 | 80 | 0.603774 |
fb3ba5acb738708a0ff3b69ad0d35162203f310f | 164 | py | Python | examples/hydra/my_app_1.py | msarahan/guildai | 99bdd09683291dbc206b6dde1b327d47401d29eb | [
"Apache-2.0"
] | 694 | 2018-11-30T01:06:30.000Z | 2022-03-31T14:46:26.000Z | examples/hydra/my_app_1.py | msarahan/guildai | 99bdd09683291dbc206b6dde1b327d47401d29eb | [
"Apache-2.0"
] | 323 | 2018-11-05T17:44:34.000Z | 2022-03-31T16:56:41.000Z | examples/hydra/my_app_1.py | msarahan/guildai | 99bdd09683291dbc206b6dde1b327d47401d29eb | [
"Apache-2.0"
] | 68 | 2019-04-01T04:24:47.000Z | 2022-02-24T17:22:04.000Z | from omegaconf import DictConfig, OmegaConf
import hydra
@hydra.main()
def my_app(cfg):
print(OmegaConf.to_yaml(cfg))
if __name__ == "__main__":
my_app()
| 16.4 | 43 | 0.719512 |
69f8e0281f9b1a44efd74bf4f225ebfc3dca4f40 | 87 | py | Python | _downloads/plot_cubist_lena8.py | dolfly/scipy-lectures.github.com | 0e5babdf839754b075ded5d986f767be35fbbe65 | [
"CC-BY-3.0"
] | null | null | null | _downloads/plot_cubist_lena8.py | dolfly/scipy-lectures.github.com | 0e5babdf839754b075ded5d986f767be35fbbe65 | [
"CC-BY-3.0"
] | null | null | null | _downloads/plot_cubist_lena8.py | dolfly/scipy-lectures.github.com | 0e5babdf839754b075ded5d986f767be35fbbe65 | [
"CC-BY-3.0"
] | null | null | null | import numpy as np
import scipy
import matplotlib.pyplot as plt
l = scipy.misc.lena()
| 14.5 | 31 | 0.770115 |
f298d8b5d561b004cd7755c66d226d5db0a6cc5a | 2,254 | py | Python | core/uploader_base.py | EngiGu/imagebed | 6016144acfa6bf0d38b37755aafaa1c430873a45 | [
"MIT"
] | 4 | 2020-02-08T05:56:50.000Z | 2020-05-13T03:25:49.000Z | core/uploader_base.py | EngiGu/imagebed | 6016144acfa6bf0d38b37755aafaa1c430873a45 | [
"MIT"
] | null | null | null | core/uploader_base.py | EngiGu/imagebed | 6016144acfa6bf0d38b37755aafaa1c430873a45 | [
"MIT"
] | null | null | null | import hashlib
import aiohttp
from core.utils import Utils
def init_server_decor(func):
def wrapper(self, *args, **kwargs):
self.log_info('*' * 30)
self.log_info('1. start init files data to db...')
result = func(self, *args, **kwargs)
return result
return wrapper
class Bas... | 30.053333 | 107 | 0.606477 |
d53f186091ef7ee40e0d540c87f5a259d69aade0 | 23,323 | py | Python | src/z3c/rml/attr.py | meteogrid/z3c.rml | cb3fecd6d6bf2a58c978e9617193b441d793f5d5 | [
"ZPL-2.1"
] | null | null | null | src/z3c/rml/attr.py | meteogrid/z3c.rml | cb3fecd6d6bf2a58c978e9617193b441d793f5d5 | [
"ZPL-2.1"
] | null | null | null | src/z3c/rml/attr.py | meteogrid/z3c.rml | cb3fecd6d6bf2a58c978e9617193b441d793f5d5 | [
"ZPL-2.1"
] | null | null | null | ##############################################################################
#
# Copyright (c) 2007 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | 34.758569 | 94 | 0.604811 |
e5c95506564373269e79629d750341b62665ece8 | 1,754 | py | Python | modules/AutoGrouping.py | MuriloChianfa/SimpleChess | 02619320f03a6d5bd30623f73056d8714276043e | [
"MIT"
] | 2 | 2020-03-15T03:05:21.000Z | 2020-03-18T17:24:56.000Z | modules/AutoGrouping.py | MuriloChianfa/SimpleTrueTable | 02619320f03a6d5bd30623f73056d8714276043e | [
"MIT"
] | null | null | null | modules/AutoGrouping.py | MuriloChianfa/SimpleTrueTable | 02619320f03a6d5bd30623f73056d8714276043e | [
"MIT"
] | null | null | null | from engine.GUI import *
EnabledAutoGrouping = False
class AutoGrouping:
def __init__(self, root):
self.AutoGrouping = GUI('AutoGrouping', 'Module: Auto Grouping')
self.AutoGrouping.DefaultWindow('DefaultWindow')
def SetAutoGrouping():
global EnabledAutoGrouping
i... | 37.319149 | 122 | 0.575257 |
3745537e8f8fe93aa52d4fd8ea2058740b6163f1 | 16,916 | py | Python | synapseclient/core/upload/multipart_upload.py | kdaily/synapsePythonClient | cef418bbc407c086224b4108ee1169f959d5fb45 | [
"Apache-2.0"
] | null | null | null | synapseclient/core/upload/multipart_upload.py | kdaily/synapsePythonClient | cef418bbc407c086224b4108ee1169f959d5fb45 | [
"Apache-2.0"
] | null | null | null | synapseclient/core/upload/multipart_upload.py | kdaily/synapsePythonClient | cef418bbc407c086224b4108ee1169f959d5fb45 | [
"Apache-2.0"
] | 1 | 2019-09-11T21:50:20.000Z | 2019-09-11T21:50:20.000Z | """
************************
Synapse Multipart Upload
************************
Implements the client side of `Synapse multipart upload`_, which provides a robust means of uploading large files (into
the 10s of GB). End users should not need to call any of these functions directly.
.. _Synapse multipart upload:
http:... | 43.597938 | 120 | 0.645365 |
d7a9e165025b0244a610c601553f14732acff231 | 4,753 | py | Python | amy/extforms/tests/test_selforganised_submission_form.py | code-review-doctor/amy | 268c1a199510457891459f3ddd73fcce7fe2b974 | [
"MIT"
] | 53 | 2015-01-10T17:39:19.000Z | 2019-06-12T17:36:34.000Z | amy/extforms/tests/test_selforganised_submission_form.py | code-review-doctor/amy | 268c1a199510457891459f3ddd73fcce7fe2b974 | [
"MIT"
] | 1,176 | 2015-01-02T06:32:47.000Z | 2019-06-18T11:57:47.000Z | amy/extforms/tests/test_selforganised_submission_form.py | code-review-doctor/amy | 268c1a199510457891459f3ddd73fcce7fe2b974 | [
"MIT"
] | 44 | 2015-01-03T15:08:56.000Z | 2019-06-09T05:33:08.000Z | from datetime import date
from django.conf import settings
from django.core import mail
from django.urls import reverse
from extforms.forms import SelfOrganisedSubmissionExternalForm
from extrequests.models import SelfOrganisedSubmission
from workshops.models import Curriculum, Language
from workshops.tests.base impo... | 37.722222 | 85 | 0.569745 |
376cfe649cb254326cbb362edfb93832dceb19fd | 70,123 | py | Python | optimus/engines/spark/columns.py | liRONCO11/optimus | 0ca0567267300397c7ba711483c46f94ac265e55 | [
"Apache-2.0"
] | null | null | null | optimus/engines/spark/columns.py | liRONCO11/optimus | 0ca0567267300397c7ba711483c46f94ac265e55 | [
"Apache-2.0"
] | null | null | null | optimus/engines/spark/columns.py | liRONCO11/optimus | 0ca0567267300397c7ba711483c46f94ac265e55 | [
"Apache-2.0"
] | null | null | null | import builtins
import os
import re
import string
import sys
import unicodedata
from heapq import nlargest
import fastnumbers
import pyspark
from multipledispatch import dispatch
from pyspark.ml.feature import Imputer, QuantileDiscretizer
from pyspark.ml.feature import VectorAssembler
from pyspark.ml.linalg import Vec... | 38.827796 | 152 | 0.597978 |
1f0624216809f3e73af3be419d84a06f1160b4c3 | 10,625 | py | Python | edb/schema/utils.py | jankeromnes/edgedb | 40ea3317fe5bfec76d7b46f7b706a4cb8a0d9f94 | [
"Apache-2.0"
] | null | null | null | edb/schema/utils.py | jankeromnes/edgedb | 40ea3317fe5bfec76d7b46f7b706a4cb8a0d9f94 | [
"Apache-2.0"
] | null | null | null | edb/schema/utils.py | jankeromnes/edgedb | 40ea3317fe5bfec76d7b46f7b706a4cb8a0d9f94 | [
"Apache-2.0"
] | null | null | null | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... | 31.434911 | 79 | 0.622306 |
36db3fa90081226bbddf3ef96a78a850a83fb492 | 417 | py | Python | Q01__/87_Repeated_DNA_Sequences/Solution.py | hsclinical/leetcode | 48a57f6a5d5745199c5685cd2c8f5c4fa293e54a | [
"Apache-2.0"
] | null | null | null | Q01__/87_Repeated_DNA_Sequences/Solution.py | hsclinical/leetcode | 48a57f6a5d5745199c5685cd2c8f5c4fa293e54a | [
"Apache-2.0"
] | null | null | null | Q01__/87_Repeated_DNA_Sequences/Solution.py | hsclinical/leetcode | 48a57f6a5d5745199c5685cd2c8f5c4fa293e54a | [
"Apache-2.0"
] | null | null | null | from typing import List
from collections import defaultdict
class Solution:
def findRepeatedDnaSequences(self, s: str) -> List[str]:
sLen = len(s)
if sLen <= 10:
return []
else:
freq = defaultdict(int)
for i in range(sLen-10+1):
freq[ s[i:... | 27.8 | 60 | 0.522782 |
28370666075714ebb3f38a57290867b1946bbb4f | 603 | py | Python | ch10-bootstrap/accounts/admin.py | wsvincent/djangoforbeginners_32 | aba7c99aa6050cfe8fb9d588af58c9f67411ae8a | [
"MIT"
] | 5 | 2021-12-14T03:33:39.000Z | 2022-01-11T14:13:21.000Z | ch9-user-authentication/accounts/admin.py | wsvincent/djangoforbeginners_32 | aba7c99aa6050cfe8fb9d588af58c9f67411ae8a | [
"MIT"
] | null | null | null | ch9-user-authentication/accounts/admin.py | wsvincent/djangoforbeginners_32 | aba7c99aa6050cfe8fb9d588af58c9f67411ae8a | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .forms import CustomUserCreationForm, CustomUserChangeForm
from .models import CustomUser
class CustomUserAdmin(UserAdmin):
add_form = CustomUserCreationForm
form = CustomUserChangeForm
model = CustomUser
list_displa... | 27.409091 | 77 | 0.689884 |
afa5986b00999209640ab5ba6aab483531769391 | 1,270 | py | Python | kipy/utility/__init__.py | Arie001/klonor-kicad | c916ae4cdac5072803e12f530ef32230732b30d7 | [
"MIT"
] | 2 | 2016-05-17T13:10:52.000Z | 2018-09-03T15:18:30.000Z | kipy/utility/__init__.py | Arie001/klonor-kicad | c916ae4cdac5072803e12f530ef32230732b30d7 | [
"MIT"
] | 1 | 2016-08-03T09:31:39.000Z | 2016-08-03T11:19:19.000Z | kipy/utility/__init__.py | Arie001/klonor-kicad | c916ae4cdac5072803e12f530ef32230732b30d7 | [
"MIT"
] | 1 | 2018-09-04T16:32:13.000Z | 2018-09-04T16:32:13.000Z | '''
Utility functions for Kicad python library
'''
from .fileaccess import FileAccess, getint
from .istring import IndexedString, refdeslist
class MetaHelper(type):
''' MetaHelper is to simplify the use of metaclasses for one useful case.
Whenever a class which uses MetaHelper as its metaclass is com... | 36.285714 | 80 | 0.631496 |
7d32428c0eac1b75911527a20ef59f033e9ba281 | 1,198 | py | Python | opensanctions/cli.py | TheophileDiot/opensanctions | 11582b0333cf0ac911a5ae795b06d0559db4a62a | [
"MIT"
] | 1 | 2020-12-10T08:04:31.000Z | 2020-12-10T08:04:31.000Z | opensanctions/cli.py | TheophileDiot/opensanctions | 11582b0333cf0ac911a5ae795b06d0559db4a62a | [
"MIT"
] | null | null | null | opensanctions/cli.py | TheophileDiot/opensanctions | 11582b0333cf0ac911a5ae795b06d0559db4a62a | [
"MIT"
] | null | null | null | import click
import logging
from followthemoney.cli.util import write_object
from opensanctions.core import Dataset, Context, setup
@click.group(help="OpenSanctions ETL toolkit")
@click.option("-v", "--verbose", is_flag=True, default=False)
@click.option("-q", "--quiet", is_flag=True, default=False)
def cli(verbose=... | 32.378378 | 83 | 0.701169 |
20f6f12949a5ba0e66362d33d5685cf103f35517 | 1,881 | py | Python | drop_ins.py | tcmRyan/DojoMiner | 19ce44e737dce13e9ee4975347ec9e9fdddce1bb | [
"MIT"
] | null | null | null | drop_ins.py | tcmRyan/DojoMiner | 19ce44e737dce13e9ee4975347ec9e9fdddce1bb | [
"MIT"
] | null | null | null | drop_ins.py | tcmRyan/DojoMiner | 19ce44e737dce13e9ee4975347ec9e9fdddce1bb | [
"MIT"
] | null | null | null | from lib.dojo_requests import DojoRequests
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Integer, Column, String, Boolean, DateTime
import os
from datetime import datetime
DB_NAME = 'customer.db'
# Request se... | 27.661765 | 99 | 0.663477 |
4e0c74f55f60f1f8f8fea88d7d428ec6d625e04a | 452 | py | Python | YearII/SemesterIII/ProgrammingInPython/Practicals/stringReverse/main.py | sudiptog81/ducscode | 4a60fb6d9a5769f9c487d0a65e557632af469903 | [
"MIT"
] | 7 | 2020-03-18T09:17:03.000Z | 2022-01-12T09:36:45.000Z | YearII/SemesterIII/ProgrammingInPython/Practicals/stringReverse/main.py | gourabdas-88006/ducscode | 19f047e02f43af430f904782850a66be32b0ff89 | [
"MIT"
] | 1 | 2020-08-27T10:33:00.000Z | 2020-08-27T10:33:00.000Z | YearII/SemesterIII/ProgrammingInPython/Practicals/stringReverse/main.py | gourabdas-88006/ducscode | 19f047e02f43af430f904782850a66be32b0ff89 | [
"MIT"
] | 4 | 2020-04-23T14:52:03.000Z | 2021-10-03T19:55:27.000Z | """
Write a Python function that takes a string as an input
from the user and displays its reverse.
Written by Sudipto Ghosh for the University of Delhi
"""
def stringReverse():
"""
Takes a string as an input from the user
and displays its reverse.
"""
string = input("Enter String:... | 18.833333 | 57 | 0.619469 |
70c6932964a86dc16c2319ba4343531190635b96 | 1,562 | py | Python | app/minime/tests/tests_serializers.py | bluecap-se/minime | 37ca7d383bafd34fe84e53c7c296b2845667122a | [
"MIT"
] | 1 | 2018-06-22T11:49:41.000Z | 2018-06-22T11:49:41.000Z | app/minime/tests/tests_serializers.py | bluecap-se/link-shortener | 37ca7d383bafd34fe84e53c7c296b2845667122a | [
"MIT"
] | 12 | 2019-10-21T17:04:35.000Z | 2022-02-10T10:30:09.000Z | app/minime/tests/tests_serializers.py | bluecap-se/link-shortener | 37ca7d383bafd34fe84e53c7c296b2845667122a | [
"MIT"
] | null | null | null | from django.test import TestCase
from .. import serializers
class SerializerTestCase(TestCase):
def test_fail_wrong_url(self):
input_data = {
'url': 'not-a-url',
}
serializer_instance = serializers.UrlSerializer(data=input_data)
self.assertFalse(serializer_instance.i... | 31.877551 | 85 | 0.65749 |
55cc1ed3a5456dae1c38ba736645504685f213d7 | 6,250 | py | Python | tests/test_controls.py | cnheider/habitat-sim | fa7bb02e9a2b56338e5bd54ffd627088f8d10d4b | [
"MIT"
] | 1 | 2020-07-11T06:16:20.000Z | 2020-07-11T06:16:20.000Z | tests/test_controls.py | cnheider/habitat-sim | fa7bb02e9a2b56338e5bd54ffd627088f8d10d4b | [
"MIT"
] | null | null | null | tests/test_controls.py | cnheider/habitat-sim | fa7bb02e9a2b56338e5bd54ffd627088f8d10d4b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import attr
import numpy as np
import pytest
import quaternion
import habitat_sim
import habitat_sim.bindings as hsim
i... | 30.788177 | 81 | 0.65088 |
d28eee2f1d61142464ffb9e93074cabc575838be | 3,938 | py | Python | strategic_exploration/hrl/reward_rule.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-01-19T23:35:59.000Z | 2022-01-19T23:35:59.000Z | strategic_exploration/hrl/reward_rule.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | null | null | null | strategic_exploration/hrl/reward_rule.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:20:29.000Z | 2022-03-30T07:20:29.000Z | # coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | 22.248588 | 74 | 0.727527 |
5f7e5fb8af1660a19a0e802659d2fa27a8ea214c | 1,261 | py | Python | accbrute.py | lucthienphong1120/full-45-bruteforce-tools | 443f19f29bd815764c43f94f06453fb899ed6215 | [
"MIT"
] | 1 | 2022-03-24T07:52:35.000Z | 2022-03-24T07:52:35.000Z | accbrute.py | lucthienphong1120/full-45-bruteforce-tools | 443f19f29bd815764c43f94f06453fb899ed6215 | [
"MIT"
] | null | null | null | accbrute.py | lucthienphong1120/full-45-bruteforce-tools | 443f19f29bd815764c43f94f06453fb899ed6215 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#Local Account BruteForcer
#http://www.darkc0de.com
#d3hydr8[at]gmail[dot]com
import sys, pwd
try:
import pexpect
except(ImportError):
print "\nYou need the pexpect module."
print "http://www.noah.org/wiki/Pexpect\n"
sys.exit(1)
#Change this if needed.
LOGIN_ERROR = 'su: incorrect password'
de... | 22.122807 | 60 | 0.66138 |
faf3acfd5a983bf97899526aa960e9e3d4fda0e2 | 1,047 | py | Python | CTFd/challenges.py | HackLirikk/MIA | f0e084f039546d032bc7af75f53ede537ca9d698 | [
"Apache-2.0"
] | null | null | null | CTFd/challenges.py | HackLirikk/MIA | f0e084f039546d032bc7af75f53ede537ca9d698 | [
"Apache-2.0"
] | null | null | null | CTFd/challenges.py | HackLirikk/MIA | f0e084f039546d032bc7af75f53ede537ca9d698 | [
"Apache-2.0"
] | null | null | null | from flask import (
render_template,
Blueprint,
)
from CTFd.utils.decorators import (
during_ctf_time_only,
require_verified_emails,
ratelimit,
require_team
)
from CTFd.utils.decorators.visibility import check_challenge_visibility
from CTFd.utils import config, text_type, user as current_user, g... | 28.297297 | 105 | 0.74212 |
3739224a75f8811d23d7449c0fddae83891ed1a3 | 32,048 | py | Python | ddtrace/tracer.py | SzySteve/dd-trace-py | 90d1d5981c72ea312c21ac04e5be47521d0f0f2e | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | ddtrace/tracer.py | SzySteve/dd-trace-py | 90d1d5981c72ea312c21ac04e5be47521d0f0f2e | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | ddtrace/tracer.py | SzySteve/dd-trace-py | 90d1d5981c72ea312c21ac04e5be47521d0f0f2e | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | import functools
import logging
import json
from os import environ, getpid
import sys
from ddtrace.vendor import debtcollector
from .constants import FILTERS_KEY, SAMPLE_RATE_METRIC_KEY, VERSION_KEY, ENV_KEY
from .ext import system
from .ext.priority import AUTO_REJECT, AUTO_KEEP
from .internal import debug
from .int... | 38.799031 | 120 | 0.600537 |
908f7ceb1ea289dd350ee5f93e4e0fcf5dd26f90 | 142 | py | Python | src/restaurants/admin.py | madebydaniz/django1-11 | 822c5b64edc2894549fd84fa8cc507f6459c321f | [
"MIT"
] | null | null | null | src/restaurants/admin.py | madebydaniz/django1-11 | 822c5b64edc2894549fd84fa8cc507f6459c321f | [
"MIT"
] | null | null | null | src/restaurants/admin.py | madebydaniz/django1-11 | 822c5b64edc2894549fd84fa8cc507f6459c321f | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import RestaurantLocation
# Register your models here.
admin.site.register(RestaurantLocation)
| 23.666667 | 39 | 0.838028 |
45de352270134e093d229acf82e50b7a7f74c1ea | 45 | py | Python | diffy/plugins/diffy_local/__init__.py | magnologan/diffy | 1d7165376a74ca97ceaeb38d185d0b6f2364a734 | [
"Apache-2.0"
] | null | null | null | diffy/plugins/diffy_local/__init__.py | magnologan/diffy | 1d7165376a74ca97ceaeb38d185d0b6f2364a734 | [
"Apache-2.0"
] | null | null | null | diffy/plugins/diffy_local/__init__.py | magnologan/diffy | 1d7165376a74ca97ceaeb38d185d0b6f2364a734 | [
"Apache-2.0"
] | null | null | null | from diffy._version import __version__ # noq | 45 | 45 | 0.822222 |
004f4dc26330f5723ce45b3e5b40b75e7306387d | 43,385 | py | Python | Compiler/program.py | fqliao/MP-SPDZ | 070fca5c52ee225fe681f16f150f5fb1a7b4b3ca | [
"BSD-2-Clause"
] | 1 | 2021-06-29T12:12:18.000Z | 2021-06-29T12:12:18.000Z | Compiler/program.py | fqliao/MP-SPDZ | 070fca5c52ee225fe681f16f150f5fb1a7b4b3ca | [
"BSD-2-Clause"
] | null | null | null | Compiler/program.py | fqliao/MP-SPDZ | 070fca5c52ee225fe681f16f150f5fb1a7b4b3ca | [
"BSD-2-Clause"
] | null | null | null | """
This module contains the building blocks of the compiler such as code
blocks and registers. Most relevant is the central :py:class:`Program`
object that holds various properties of the computation.
"""
from Compiler.config import *
from Compiler.exceptions import *
from Compiler.instructions_base import RegType
im... | 38.702052 | 116 | 0.55072 |
b73dee89967b8803dcfc31840d3e7aa867755725 | 4,414 | py | Python | old/ImageManipulation.py | gumbald/photobooth | 930527e3f9232a7bbf637d445f4e5ce77d5cb0ec | [
"MIT"
] | null | null | null | old/ImageManipulation.py | gumbald/photobooth | 930527e3f9232a7bbf637d445f4e5ce77d5cb0ec | [
"MIT"
] | null | null | null | old/ImageManipulation.py | gumbald/photobooth | 930527e3f9232a7bbf637d445f4e5ce77d5cb0ec | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from PIL import Image
import numpy as np
#import matplotlib.cm as cm
import Reference as r
def convert_photo_to_monochrome(image):
''' Converts a given image object to monocrhome and saves down the converted version
Uses this guide (last method on list) to conver... | 34.484375 | 132 | 0.680109 |
6fca3637416d94c34eec12961fff8e57097a21b3 | 423 | py | Python | env/lib/python3.8/site-packages/plotly/validators/area/_t.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/area/_t.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/area/_t.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class TValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="t", parent_name="area", **kwargs):
super(TValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwargs... | 32.538462 | 70 | 0.638298 |
2f768063414cc895ed52929d33762f8c1fcbf718 | 576 | py | Python | tests/test_udb_when_validate_query.py | akaterra/udb.py | 3c04fa788e4b2fc8356c1210b9d81004aa932c0b | [
"MIT"
] | 2 | 2020-01-04T12:04:58.000Z | 2020-02-15T16:32:12.000Z | tests/test_udb_when_validate_query.py | akaterra/udb.py | 3c04fa788e4b2fc8356c1210b9d81004aa932c0b | [
"MIT"
] | null | null | null | tests/test_udb_when_validate_query.py | akaterra/udb.py | 3c04fa788e4b2fc8356c1210b9d81004aa932c0b | [
"MIT"
] | null | null | null | import pytest
from udb_py.udb import Udb, UdbIndex
class UdbIndexA(UdbIndex):
q = None
@classmethod
def validate_query(cls, q):
cls.q = q
return True
class UdbIndexB(UdbIndex):
q = None
@classmethod
def validate_query(cls, q):
cls.q = q
return True
@pyt... | 16 | 48 | 0.576389 |
6a61bcadee5d1a789923e24a082394da92d9bd8a | 248 | py | Python | utils/parsehelp.py | Shlol762/CauveryBot | e7ca4a289f6c661e53133249b630a64a81a7a9d7 | [
"MIT"
] | null | null | null | utils/parsehelp.py | Shlol762/CauveryBot | e7ca4a289f6c661e53133249b630a64a81a7a9d7 | [
"MIT"
] | null | null | null | utils/parsehelp.py | Shlol762/CauveryBot | e7ca4a289f6c661e53133249b630a64a81a7a9d7 | [
"MIT"
] | null | null | null | import json
from discord.ext.commands import Command
def parse_help(command: Command) -> str:
with open("C:/Users/Shlok/CauveryBot/json/help.json", "r") as f:
help_: dict = json.load(f)
return ''.join(help_[command.name.lower()])
| 27.555556 | 68 | 0.681452 |
4ccad6a5cff1a67cc32edce8a9c8cf6910fd1f77 | 955 | py | Python | web2py/applications/rip/controllers/Home.py | 2spmohanty/vcenter-automation | 1d10b765ef335087902b0194ed12a61e53807987 | [
"Apache-2.0"
] | 1 | 2019-10-02T13:25:03.000Z | 2019-10-02T13:25:03.000Z | web2py/applications/rip/controllers/Home.py | 2spmohanty/vcenter-automation | 1d10b765ef335087902b0194ed12a61e53807987 | [
"Apache-2.0"
] | null | null | null | web2py/applications/rip/controllers/Home.py | 2spmohanty/vcenter-automation | 1d10b765ef335087902b0194ed12a61e53807987 | [
"Apache-2.0"
] | 1 | 2021-11-05T09:51:02.000Z | 2021-11-05T09:51:02.000Z | __author__ = 'smrutim'
# -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
#########################################################################
## This is a Home controller
#########################################################################
impo... | 22.738095 | 80 | 0.596859 |
94c2d5b83869dbc4b695f9f7eb5e1a6376bd80c9 | 580 | py | Python | dataset_analyses/mongo.py | oesteban/OpenNeuro_analyses | 7535aedb576e90d43f95f031fb3c8091497c6810 | [
"MIT"
] | null | null | null | dataset_analyses/mongo.py | oesteban/OpenNeuro_analyses | 7535aedb576e90d43f95f031fb3c8091497c6810 | [
"MIT"
] | null | null | null | dataset_analyses/mongo.py | oesteban/OpenNeuro_analyses | 7535aedb576e90d43f95f031fb3c8091497c6810 | [
"MIT"
] | 1 | 2022-03-12T22:02:10.000Z | 2022-03-12T22:02:10.000Z | # mongo utils
from pymongo import MongoClient
import pymongo
def get_db_collection():
client = MongoClient()
db = client.openneuro
return(db.datasets)
def add_info_to_db(info):
collection = get_db_collection()
collection.insert_one(info)
def ds_from_database(dsnum):
collection = get_db_col... | 21.481481 | 63 | 0.717241 |
1f073a0a5ed8ecba555c2b81844751adbda5cb35 | 24,755 | py | Python | src/werkzeug/exceptions.py | kam193/werkzeug | 1129879c79f8415d4ea9a67d7c5ce2f2e1d28c78 | [
"BSD-3-Clause"
] | null | null | null | src/werkzeug/exceptions.py | kam193/werkzeug | 1129879c79f8415d4ea9a67d7c5ce2f2e1d28c78 | [
"BSD-3-Clause"
] | null | null | null | src/werkzeug/exceptions.py | kam193/werkzeug | 1129879c79f8415d4ea9a67d7c5ce2f2e1d28c78 | [
"BSD-3-Clause"
] | 1 | 2020-12-29T18:02:18.000Z | 2020-12-29T18:02:18.000Z | """Implements a number of Python exceptions which can be raised from within
a view to trigger a standard HTTP non-200 response.
Usage Example
-------------
.. code-block:: python
from werkzeug.wrappers import BaseRequest
from werkzeug.wsgi import responder
from werkzeug.exceptions import HTTPException, N... | 30.486453 | 87 | 0.65821 |
ab4e6a27fb540ed8caba92f95a817f2dcce3d005 | 818 | py | Python | lstchain/spectra/proton.py | maxnoe/cta-lstchain | 99f4fc01248ea1dbc8f86544930661ebbe84961e | [
"BSD-3-Clause"
] | 19 | 2018-05-30T14:13:16.000Z | 2022-03-10T14:04:04.000Z | lstchain/spectra/proton.py | maxnoe/cta-lstchain | 99f4fc01248ea1dbc8f86544930661ebbe84961e | [
"BSD-3-Clause"
] | 868 | 2018-05-31T12:02:25.000Z | 2022-03-30T16:02:42.000Z | lstchain/spectra/proton.py | maxnoe/cta-lstchain | 99f4fc01248ea1dbc8f86544930661ebbe84961e | [
"BSD-3-Clause"
] | 76 | 2018-05-31T09:59:02.000Z | 2022-01-29T17:57:49.000Z | import astropy.units as u
import numpy as np
__all__ = ['proton_bess']
def proton_bess(E):
""" From http://adsabs.harvard.edu/abs/2000ApJ...545.1135S
For each energy point, return the Proton flux
Parameters
-----------
E: `numpy.ndarray` of astropy.units.quantity.Quantity (energy units)
Re... | 24.058824 | 79 | 0.590465 |
b5351703405615a73f0b55265c6b9f7e98b23cd7 | 1,438 | py | Python | app/models/tables.py | PaulloClara/Toilter | 2bb170bfb64b74dde484cc5aeac9720551916778 | [
"MIT"
] | null | null | null | app/models/tables.py | PaulloClara/Toilter | 2bb170bfb64b74dde484cc5aeac9720551916778 | [
"MIT"
] | null | null | null | app/models/tables.py | PaulloClara/Toilter | 2bb170bfb64b74dde484cc5aeac9720551916778 | [
"MIT"
] | 1 | 2021-06-23T21:12:21.000Z | 2021-06-23T21:12:21.000Z | from app import db
class User(db.Model):
__tablename__ = 'users'
id_ = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String, unique=True)
password = db.Column(db.String)
name = db.Column(db.String)
email = db.Column(db.String, unique=True)
@property
def is_authenticated(self):
... | 22.825397 | 62 | 0.687761 |
e7d5c8420cd1dacb905243d30558a5e0b364a12b | 1,044 | py | Python | AppFilme/views.py | gelsonmarcelo/webdjango-crud-filmes | b115a0e3f5d05f8d78c27b2fc46da6e2631c2b05 | [
"Unlicense"
] | null | null | null | AppFilme/views.py | gelsonmarcelo/webdjango-crud-filmes | b115a0e3f5d05f8d78c27b2fc46da6e2631c2b05 | [
"Unlicense"
] | null | null | null | AppFilme/views.py | gelsonmarcelo/webdjango-crud-filmes | b115a0e3f5d05f8d78c27b2fc46da6e2631c2b05 | [
"Unlicense"
] | null | null | null | from django.views.generic.base import TemplateView
from django.views.generic.edit import CreateView
from django.views.generic import UpdateView
from django.views.generic import DeleteView
from django.views.generic import ListView
from ProjetoFilmes.models import Filme
from django.urls.base import reverse_lazy
###
# -*... | 28.216216 | 50 | 0.726054 |
30e8018b598ac7ec08eced9d98a8e66e4f26e529 | 5,321 | py | Python | data/external/repositories_2to3/236942/homesite-master/python/build_meta_kerasmall.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/236942/homesite-master/python/build_meta_kerasmall.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/236942/homesite-master/python/build_meta_kerasmall.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z | """
Created on Thu Dec 10 10:44:27 2015
@author: konrad
"""
from keras.regularizers import l2, activity_l2
import numpy as np
import pandas as pd
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.layers.normalization import BatchNormalization
from keras.... | 40.007519 | 179 | 0.576395 |
aad688ef0f31a72df1a580cdfc7f949dc65e29df | 1,782 | py | Python | Chapter04/aws_dynamo/dynamo_modify_items.py | davedmiller/Building-Serverless-Microservices-in-Python | a93c68a19ec3c8dbe12bc2e0dc06a0f4488c294c | [
"MIT"
] | null | null | null | Chapter04/aws_dynamo/dynamo_modify_items.py | davedmiller/Building-Serverless-Microservices-in-Python | a93c68a19ec3c8dbe12bc2e0dc06a0f4488c294c | [
"MIT"
] | null | null | null | Chapter04/aws_dynamo/dynamo_modify_items.py | davedmiller/Building-Serverless-Microservices-in-Python | a93c68a19ec3c8dbe12bc2e0dc06a0f4488c294c | [
"MIT"
] | null | null | null | """
Copyright (c) 2017-2019 Starwolf Ltd and Richard Freeman. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License").
You may not use this file except in compliance with the License.
A copy of the License is located at http://www.apache.org/licenses/LICENSE-2.0
or in the "license" file a... | 34.269231 | 85 | 0.7211 |
f0749d1bf47e46f214839ecab47de4a045a0a1d5 | 5,709 | py | Python | unicorn_mode/samples/compcov_x64/compcov_test_harness.py | StarGazerM/AFLplusplus | 15340b85e88c72176ef303950376234abca7ee6b | [
"Apache-2.0"
] | 2,104 | 2020-03-19T16:17:10.000Z | 2022-03-31T16:22:30.000Z | unicorn_mode/samples/compcov_x64/compcov_test_harness.py | StarGazerM/AFLplusplus | 15340b85e88c72176ef303950376234abca7ee6b | [
"Apache-2.0"
] | 788 | 2020-03-19T14:54:09.000Z | 2022-03-31T17:38:00.000Z | unicorn_mode/samples/compcov_x64/compcov_test_harness.py | StarGazerM/AFLplusplus | 15340b85e88c72176ef303950376234abca7ee6b | [
"Apache-2.0"
] | 518 | 2020-03-21T01:24:55.000Z | 2022-03-30T21:05:53.000Z | #!/usr/bin/env python
"""
Simple test harness for AFL's Unicorn Mode.
This loads the compcov_target.bin binary (precompiled as MIPS code) into
Unicorn's memory map for emulation, places the specified input into
compcov_target's buffer (hardcoded to be at 0x300000), and executes 'main()'.
If any crashes ... | 33 | 121 | 0.644246 |
71389dcf5b48c0f8cada7db2bb85ee118f4626ad | 7,755 | py | Python | AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GraphComponentSync.py | cypherdotXd/o3de | bb90c4ddfe2d495e9c00ebf1e2650c6d603a5676 | [
"Apache-2.0",
"MIT"
] | 1 | 2022-03-12T14:13:45.000Z | 2022-03-12T14:13:45.000Z | AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GraphComponentSync.py | cypherdotXd/o3de | bb90c4ddfe2d495e9c00ebf1e2650c6d603a5676 | [
"Apache-2.0",
"MIT"
] | 2 | 2022-01-13T04:29:38.000Z | 2022-03-12T01:05:31.000Z | AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GraphComponentSync.py | cypherdotXd/o3de | bb90c4ddfe2d495e9c00ebf1e2650c6d603a5676 | [
"Apache-2.0",
"MIT"
] | null | null | null | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C4705586 - Altering connections on graph nodes appropriately updates component properties
C22715182 - Compo... | 46.160714 | 120 | 0.680206 |
a28ace56dec9093052507dd124d55295ef05ec39 | 1,699 | py | Python | libai/data/datasets/gpt_dataset.py | Kitten97/libai | 4ca0341628dc0b850acbc30d3766797cfc8a6c86 | [
"Apache-2.0"
] | null | null | null | libai/data/datasets/gpt_dataset.py | Kitten97/libai | 4ca0341628dc0b850acbc30d3766797cfc8a6c86 | [
"Apache-2.0"
] | null | null | null | libai/data/datasets/gpt_dataset.py | Kitten97/libai | 4ca0341628dc0b850acbc30d3766797cfc8a6c86 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The OneFlow 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 require... | 33.313725 | 84 | 0.711006 |
47fa8614b53d629f86ade27d7e7f28dff4ef8f2a | 310 | py | Python | dockerbaseimage/attacks/discovery.py | mrlooquer/ipv6-iot-security | 912fddb7c27dae002244b5c98cd1363152324ea1 | [
"Apache-2.0"
] | 1 | 2021-03-29T14:01:59.000Z | 2021-03-29T14:01:59.000Z | dockerbaseimage/attacks/discovery.py | mrlooquer/ipv6-iot-security | 912fddb7c27dae002244b5c98cd1363152324ea1 | [
"Apache-2.0"
] | null | null | null | dockerbaseimage/attacks/discovery.py | mrlooquer/ipv6-iot-security | 912fddb7c27dae002244b5c98cd1363152324ea1 | [
"Apache-2.0"
] | null | null | null | from scapy.all import *
from scapy.layers.inet6 import *
import random
valid_host_address='0123456789abcdef'
for i in range(14):
target_ip = "2a02:16:33::" + valid_host_address[i]
p=IPv6(dst=target_ip)/ICMPv6EchoRequest()
send(p,verbose=False)
print "Packets sent: " + str(i)
| 25.833333 | 58 | 0.677419 |
bec99c573fab138eb090febb639a5cd0f946035c | 3,135 | py | Python | AircraftsDataset.py | cvl-umass/bilinear-cnn | d6a05aa200774c97b38f753feed9032aa3764cce | [
"MIT"
] | 9 | 2020-06-07T09:57:23.000Z | 2021-12-27T08:02:45.000Z | AircraftsDataset.py | cvl-umass/bilinear-cnn | d6a05aa200774c97b38f753feed9032aa3764cce | [
"MIT"
] | 3 | 2021-06-08T21:47:36.000Z | 2022-01-13T02:51:06.000Z | AircraftsDataset.py | cvl-umass/bilinear-cnn | d6a05aa200774c97b38f753feed9032aa3764cce | [
"MIT"
] | null | null | null | import torch
import torch.utils.data as data
import numpy as np
import os
from torchvision.datasets import folder as dataset_parser
import json
def make_dataset(dataset_root, imageRoot, split, level='variant',
subset=False):
if level == 'variant':
class_meta = 'variants'
elif level == ... | 31.039604 | 83 | 0.594577 |
20d3f8efb42d622349f7911a8d48725c72cff1cf | 7,646 | py | Python | tests/test_message_callback.py | sarog/python-insteonplm | dd38b9781167b8fd0bf3d3bf36770aa36bc0275b | [
"MIT"
] | null | null | null | tests/test_message_callback.py | sarog/python-insteonplm | dd38b9781167b8fd0bf3d3bf36770aa36bc0275b | [
"MIT"
] | null | null | null | tests/test_message_callback.py | sarog/python-insteonplm | dd38b9781167b8fd0bf3d3bf36770aa36bc0275b | [
"MIT"
] | null | null | null | """Test message callbacks."""
import logging
from insteonplm.messagecallback import MessageCallback
from insteonplm.constants import (COMMAND_LIGHT_ON_0X11_NONE,
MESSAGE_ACK,
MESSAGE_NAK)
from insteonplm.messages.standardReceive import StandardReceive... | 38.23 | 76 | 0.726131 |
798033b10ff7b8ab8c115455c4b8245059f16756 | 10,371 | py | Python | xlsxwriter/test/worksheet/test_write_auto_filter.py | totdiao/XlsxWriter | 3d65858d8933bddb8262d500bcc2005f28fde645 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/worksheet/test_write_auto_filter.py | totdiao/XlsxWriter | 3d65858d8933bddb8262d500bcc2005f28fde645 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/worksheet/test_write_auto_filter.py | totdiao/XlsxWriter | 3d65858d8933bddb8262d500bcc2005f28fde645 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ...worksheet import Worksheet
class TestWriteAutoFilter(unittest.TestCase):
"""
... | 35.155932 | 241 | 0.649021 |
aff1e021ab23b94ad2979cd8128a82082e882512 | 273 | py | Python | nytimesScraper/nytimesScraper/items.py | hassaanm/business-articles | 359804a453b716c15d3af6733d7b461d876f8d75 | [
"Apache-2.0"
] | 3 | 2015-04-27T22:30:39.000Z | 2018-06-16T13:14:21.000Z | nytimesScraper/nytimesScraper/items.py | hassaanm/business-articles | 359804a453b716c15d3af6733d7b461d876f8d75 | [
"Apache-2.0"
] | null | null | null | nytimesScraper/nytimesScraper/items.py | hassaanm/business-articles | 359804a453b716c15d3af6733d7b461d876f8d75 | [
"Apache-2.0"
] | null | null | null | # Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/topics/items.html
from scrapy.item import Item, Field
class Article(Item):
url = Field()
title = Field()
text = Field()
company = Field()
date = Field()
| 19.5 | 47 | 0.659341 |
c82db237f4969306cb61974155b2700ff98ebbaf | 1,714 | py | Python | syte/urls.py | domenicosolazzo/syte | 68be830dc64781ccadf377dda25e2a3dc2dd685f | [
"Unlicense"
] | null | null | null | syte/urls.py | domenicosolazzo/syte | 68be830dc64781ccadf377dda25e2a3dc2dd685f | [
"Unlicense"
] | 2 | 2021-04-30T21:43:42.000Z | 2021-06-11T00:00:31.000Z | syte/urls.py | domenicosolazzo/syte | 68be830dc64781ccadf377dda25e2a3dc2dd685f | [
"Unlicense"
] | null | null | null |
from django.conf.urls import patterns, include, url
from django.conf import settings
handler404 = 'syte.views.page_not_found_error'
handler500 = 'syte.views.server_error'
urlpatterns = patterns('',
url(r'^post/(?P<post_id>\w+)/?$', 'syte.views.blog_post'),
url(r'^post/ajax/(?P<post_id>\w+)/?$', 'syte.views.b... | 28.098361 | 75 | 0.63769 |
d109f81b5d9ebb2115c8208c37eecaf808bba12c | 660 | py | Python | Module 1/Chapter 14/prog3.py | PacktPublishing/Raspberry-Pi-Making-Amazing-Projects-Right-from-Scratch- | 49fd30ca8e1e30e7d85cf14e9dcb6e1d24d4a445 | [
"MIT"
] | 3 | 2016-11-15T02:27:27.000Z | 2017-12-28T20:14:21.000Z | Module 1/Chapter 14/prog3.py | PacktPublishing/Raspberry-Pi-Making-Amazing-Projects-Right-from-Scratch- | 49fd30ca8e1e30e7d85cf14e9dcb6e1d24d4a445 | [
"MIT"
] | null | null | null | Module 1/Chapter 14/prog3.py | PacktPublishing/Raspberry-Pi-Making-Amazing-Projects-Right-from-Scratch- | 49fd30ca8e1e30e7d85cf14e9dcb6e1d24d4a445 | [
"MIT"
] | 5 | 2017-12-28T20:16:05.000Z | 2021-04-22T17:30:05.000Z | import socket #for sockets
import sys #for exit
# create dgram udp socket
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
except socket.error:
print 'Failed to create socket'
sys.exit()
host = 'localhost';
port = 8888;
while(1) :
msg = raw_input('Enter message to send : ')
try :
... | 21.290323 | 66 | 0.580303 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.