text
string
size
int64
token_count
int64
import angr from angr.sim_type import SimTypeInt import logging l = logging.getLogger("angr.procedures.libc.tolower") class tolower(angr.SimProcedure): def run(self, c): self.argument_types = {0: SimTypeInt(self.state.arch, True)} self.return_type = SimTypeInt(self.state.arch, True) retu...
430
159
import json from datetime import datetime from freezegun import freeze_time from app.models import AuditEvent, db, Framework, FrameworkAgreement, User from tests.helpers import fixture_params from tests.bases import BaseApplicationTest class BaseFrameworkAgreementTest(BaseApplicationTest): def create_agreement(se...
54,652
17,507
import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns from sklearn.datasets import load_boston from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_squared_error from sklearn.metrics import r2_score...
4,730
2,211
""" MIT License Copyright (c) 2022 ItsTato 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, modify, merge, publish, dist...
9,746
4,181
import data_mine as dm from data_mine.nlp.cosmos_qa import CosmosQAType def main(): df = dm.COSMOS_QA(CosmosQAType.TRAIN) print(df) print("\n") df = df.sample(n=1) row = next(df.iterrows())[1] print("Question: ", row.question, "\n") print("Context: ", row.context, "\n") for i, answer...
500
196
# Copyright 2016 Vimal Manohar # Apache 2.0 """ This library has classes and methods commonly used for training nnet3 neural networks. It has separate submodules for frame-level objectives and chain objective: frame_level_objf -- For both recurrent and non-recurrent architectures chain_objf -- LF-MMI objective train...
365
111
# used for connecting to the trusted capsule server import socket TCP_IP = '127.0.0.1' TCP_PORT = 4000 BUFFER_SIZE = 1024 MESSAGE = "Hello, World!" def connect(ip: str, port: int, request: bytes): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((ip, port)) s.send(request) print("sent"...
462
188
from randonet.generator.param import Param, IntParam, FloatParam, BinaryParam, ChoiceParam, TupleParam from randonet.generator.unit import Unit, Factory as _Factory from randonet.generator.conv import ConvFactory, ConvTransposeFactory from collections import namedtuple class TransformerEncoder(_Factory): def __i...
3,821
1,160
# coding: utf-8 # # Copyright 2022 :Barry-Thomas-Paul: Moss # # 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...
6,566
1,793
from rest_framework import serializers from . import models class ShelterSerializer(serializers.ModelSerializer): class Meta: model = models.Shelter fields = ('name', 'location') class DogSerializer(serializers.ModelSerializer): class Meta: model = models.Dog ...
548
143
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) from ...extern import six import io from ..xml import check, unescaper, writer def test_writer(): fh = io.StringIO() w = writer.XMLWri...
2,146
819
# # Copyright 2022 DMetaSoul # # 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 writin...
1,688
526
# ESC180 Lab 6 # lab6_ttt.py # Oct 15, 2021 # Done in collaboration by: # Ma, Carl Ka To (macarl1) and # Xu, Shen Xiao Zhu (xushenxi) ''' X | O | X ---+---+--- O | O | X ---+---+--- | X | ''' import random def print_board_and_legend(board): for i in range(3): line1 = " " + board[i][0] + " |...
6,174
2,180
#!/usr/bin/python3 # coding=utf-8 """ Chuck Norris and Other Jokes Module copyright 2015 phm.link Licensed under Mozilla Public License Version 2. """ from __future__ import unicode_literals from __future__ import print_function from __future__ import division import json import jsonrpc from sopel.module import command...
3,503
1,294
""" The classes and methods in this file are derived or pulled directly from https://github.com/sfujim/BCQ/tree/master/discrete_BCQ which is a discrete implementation of BCQ by Scott Fujimoto, et al. and featured in the following 2019 DRL NeurIPS workshop paper: @article{fujimoto2019benchmarking, title={Benchmarking ...
10,569
3,962
import struct _SetSeparator=b"_~|IMMU|~_" def wrap_zindex_ref(key: bytes, index) -> bytes: fmt=">{}sQB".format(len(key)) if index!=None and index.index!=None: ret=struct.pack(fmt,key,index.index,1) else: ret=struct.pack(fmt,key,0,0) return ret def unwrap_zindex_ref(value:bytes): l=len(value) fmt=">{}sQB".f...
684
299
#!python3 """ Utilities for computing random expertise levels. """ import numpy as np from scipy.stats import truncnorm, beta def fixed_expertise_levels(mean:float, size:int): return np.array([mean]*size) MIN_PROBABILITY=0.501 MAX_PROBABILITY=0.999 def truncnorm_expertise_levels(mean:float, std:float, size:int)...
3,122
1,260
"""Testing the Flask application factory""" import os import tempfile import textwrap from interpersonal import create_app def test_config(): """Test the application configuration Make sure it works in testing mode and in normal mode. """ db_fd, db_path = tempfile.mkstemp() conf_fd, conf_path =...
1,132
351
import numpy as np from backend_keypoints import create_score_maps, extract_2D_keypoints from backend_keypoints import crop_image_from_coordinates, extract_keypoints from backend_keypoints import crop_image_from_mask, extract_hand_segment from backend_keypoints import extract_bounding_box, find_max_location from backe...
6,077
1,853
import BaseHook from browser import window from javascript import JSObject import sys sys.path.append("../FileSystem") import FileObject #define my custom import hook (just to see if it get called etc). class FileSystemHook(BaseHook.BaseHook): def __init__(self, fullname, path): BaseHook.BaseHook.__init__(se...
954
295
import sql as sql import streamlit as st from streamlit_folium import folium_static import matplotlib.pyplot as plt import pandas as pd import seaborn as sns import json import sys import folium import requests from bs4 import BeautifulSoup import csv from tqdm import tqdm import webbrowser import os.path as osp import...
15,753
6,004
"""Module defining the init process for TuxEatPi component""" import logging class Initializer(object): """Initializer class to run init action for a component""" def __init__(self, component, skip_dialogs=False, skip_intents=False, skip_settings=False): self.component = component self.skip_d...
1,236
333
default_app_config = 'sponsoring.apps.SponsoringConfig'
56
20
# Generated by Django 2.2.12 on 2020-07-18 07:59 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('movie', '0002_auto_20200717_1039'), ] operations = [ migrations.RemoveField( model_name='show', name='plot', ...
922
274
colors_per_chi = {2: 'green', 3: 'orange', 4: 'purple', 5: 'pink', 6: 'red'} style_per_chi = {2: '-', 3: '-.', 4: 'dotted'} markers_per_reason = {'converged': 'o', 'progress': 'x', 'ressources': 'v'} linewidth = 5.31596
220
106
def calculate_compass_distance(origin, destination): import math origin_latitude, origin_longitude = origin destination_latitude, destination_longitude = destination # 3959 = > Miles and 6371 = > KM # unit in meters radius = 6371*1000 dlat = math.radians(destination_latitude-origin_latitude)...
2,222
930
# -*- coding: utf-8 -*- """@package isotime Creates a string containing the current local time in ISO 8601 basic format @author: Chris Mirabito (mirabito@mit.edu) """ from datetime import datetime #from matplotlib.dates import SEC_PER_DAY SEC_PER_DAY = 86400 def isotime(): """Current local time in ISO 8601 basic...
757
278
"""A simple base for creating common types of work-db filters. """ import argparse import logging import sys from exit_codes import ExitCode from cosmic_ray.work_db import use_db class FilterApp: """Base class for simple WorkDB filters. This provides command-line handling for common filter options like ...
1,980
529
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 18-10-28 上午11:51 # @Author : Vitan # @File : mao.py import requests import re import json from multiprocessing import Pool from requests.exceptions import RequestException def get_one_page(url): headers = {'user-agent': 'Mozilla/5.0 (X11;...
1,702
716
from distutils.core import setup setup( name='shortest-python', packages=['shortest'], version='0.1', description='Python library for shorte.st url shortener', long_description="More on github: https://github.com/CubexX/shortest-python", author='CubexX', author_email='root@cubexx.xyz', ...
446
149
# # Building and Evaluating Random Forest Model # ## Setup # Import useful packages, modules, classes, and functions: from __future__ import print_function from pyspark.sql import SparkSession from pyspark.sql.functions import col #import numpy as np #import pandas as pd import matplotlib.pyplot as plt #import seabor...
3,381
1,103
""" Implementation of vegas+ algorithm: adaptive importance sampling + adaptive stratified sampling from https://arxiv.org/abs/2009.05112 The main interface is the `VegasFlowPlus` class. """ from itertools import product import numpy as np import tensorflow as tf from vegasflow.configflow import ( ...
9,761
3,142
from neo4j import GraphDatabase port = 7688 data_uri = 'bolt://localhost:' + str(port) username = 'neo4j' password = 'abc123' # data_creds = (username, password) data_creds = None driver = GraphDatabase.driver(data_uri, auth=data_creds) def close_db(): driver.close() def clear_db(): with driver.session() a...
4,259
1,408
""" State stores are used to track the handlers' states across handling cycles. Specifically, they track which handlers are finished, which are not yet, and how many retries were there, and some other information. There could be more than one low-level k8s watch-events per one actual high-level kopf-event (a cause). ...
12,441
3,672
from abc import ABC class AbstractInstanceConfig(ABC): def __init__(self, config: dict): self._name = config['name'] self._provider_name = config['provider'] self._params = config['parameters'] @property def name(self) -> str: """Name of the instance.""" return se...
1,045
288
def get_failed_ids(txt_file): id = [] fh = open(txt_file, 'r') for row in fh: id.append(row.split('/')[1].split('.')[0]) return(id)
157
65
#!/usr/bin/env python from distutils.core import setup long_description = """TiDB backend for Django""" setup( name='django_tidb', version='2.1', author='Rain Li', author_email='blacktear23@gmail.com', url='http://github.com/blacktear23/django_tidb', download_url='http://github.com/blackear23...
887
279
import smtplib def get_binary(src_file): with open(src_file, 'rb') as f: return f.read() def send_mail(to, username, password, message_type='account_creation'): server = 'smtp.mail.me.com' port = 587 email = 'mailid' _password = 'password' if message_type == 'account_creation': ...
6,347
2,147
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = ''' --- module: lambda_alias version_added: 1.0.0 short_description: Create...
10,610
3,156
from __future__ import annotations from typing import TYPE_CHECKING from dependency_injector.wiring import Provide, inject from server.container import AppContainer from ._types import BotInventoryContainers, LootGenerationConfig if TYPE_CHECKING: # pylint: disable=cyclic-import from tarkov.bots.bots import...
1,148
327
from datadog_checks.base import OpenMetricsBaseCheckV2 from .metrics import METRIC_MAP class CalicoCheck(OpenMetricsBaseCheckV2): def __init__(self, name, init_config, instances=None): super(CalicoCheck, self).__init__( name, init_config, instances, ) def...
411
130
#!/usr/bin/python # -*- coding: utf-8 -*- # @Date : 2016-05-17 16:36:18 # @Author : Yunyu2019 (yunyu2010@yeah.net) # @Link : http://www.pythonchallenge.com/pc/hex/lake.html import os import wave import time import Image import requests def download(urls): filename=os.path.basename(urls) ...
1,059
468
#!/usr/bin/env python ''' Copyright (c) 2020 RIKEN All Rights Reserved See file LICENSE for details. ''' import os,sys,datetime,multiprocessing from os.path import abspath,dirname,realpath,join import log,traceback # http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python def which(program): ...
2,645
820
# !/usr/bin/env python3 """ Unit tests for RUST linter clippy This class has been automatically generated by .automation/build.py, please do not update it manually """ from unittest import TestCase from megalinter.tests.test_megalinter.LinterTestRoot import LinterTestRoot class rust_clippy_test(TestCase, LinterTest...
381
124
import mock from acmdrunner import Loader import os import tests.management.acr_commands active_dir = os.getcwd() cur_dir = os.path.dirname(__file__) def test_load_from_directory(): with mock.patch( 'acmdrunner.loader.load_commands_from_directory', autospec=True ) as commands_mock: ...
868
271
from pydantic_avro.avro_to_pydantic import avsc_to_pydantic def test_avsc_to_pydantic_empty(): pydantic_code = avsc_to_pydantic({"name": "Test", "type": "record", "fields": []}) assert "class Test(BaseModel):\n pass" in pydantic_code def test_avsc_to_pydantic_primitive(): pydantic_code = avsc_to_pyda...
6,838
2,141
from django.test import TestCase from dojo.models import Test from dojo.tools.cloudsploit.parser import CloudsploitParser class TestCloudsploitParser(TestCase): def test_cloudsploit_parser_with_no_vuln_has_no_findings(self): testfile = open("dojo/unittests/scans/cloudsploit/cloudsploit_zero_vul.json") ...
1,128
389
from aws_cdk import core import aws_cdk.aws_ec2 as ec2 import aws_cdk.aws_s3 as s3 import aws_cdk.aws_s3_deployment as s3deploy import aws_cdk.aws_iam as iam class MwaaCdkStackDeployFiles(core.Stack): def __init__(self, scope: core.Construct, id: str, vpc, mwaa_props, **kwargs) -> None: super().__init__...
1,329
441
""" Do Not Edit this file. You may and are encouraged to look at it for reference. """ import sys if sys.version_info.major != 3: print('You must use Python 3.x version to run this unit test') sys.exit(1) import unittest import main class TestGetUserString(unittest.TestCase): def input_replacement(self...
2,743
828
from datetime import datetime, timedelta from django.conf import settings from django.core.management.base import BaseCommand from django.db import connection from phonelog.models import OldDeviceReportEntry, DeviceReportEntry COLUMNS = ( "xform_id", "i", "msg", "type", "date", "server_date", "domain", "devi...
1,386
398
import pygame import math from pygame.locals import * from OpenGL.GL import * ######################################################## ################## CONFIGURAÇÕES MESA ################## larCamp = 1160 altCamp = 770 passo = 0.53 apasso = 0.18 #deg xJog = 30 yJog = 40 has = 10 hasG...
5,180
2,604
""" Implementation of Linked List reversal. """ # Author: Nikhil Xavier <nikhilxavier@yahoo.com> # License: BSD 3 clause class Node: """Node class for Singly Linked List.""" def __init__(self, value): self.value = value self.next_node = None def reverse_linked_list(head): """Reverse li...
660
205
import argparse from sklearn import decomposition from sklearn.manifold import TSNE from scripts.utils.utils import init_logger, save_npz from scripts.utils.documents import load_document_topics logger = init_logger() def main(): parser = argparse.ArgumentParser(description='maps a given high-dimensional documen...
1,310
434
from collections import defaultdict class Solution(object): def countPairs(self, deliciousness): """ :type deliciousness: List[int] :rtype: int """ max_sum = max(deliciousness) * 2 count = 0 dictionary = defaultdict(int) for value in deliciousness: ...
551
160
#!/usr/bin/env python ''' Port Google Bookmarks over to pinboard.in * Export Google Bookmarks by hitting http://www.google.com/bookmarks/?output=xml&num=10000 * Get pinboard auth_token from https://pinboard.in/settings/password Run: ./gbmk2pinb.py bookmarks.xml --auth-token <token> ''' import requests from cS...
2,900
1,022
#!/usr/bin/env python3 # # Copyright 2016-2017 Games Creators Club # # MIT License # import traceback import time import re import copy import pyroslib import storagelib import smbus # # wheels service # # # This service is responsible for moving wheels on the rover. # Current implementation also handles: # - se...
11,106
3,975
import os import re import subprocess from ..segment import BasicSegment class Repo(object): symbols = { "detached": "\u2693", "ahead": "\u2B06", "behind": "\u2B07", "staged": "\u2714", "changed": "\u270E", "new": "\uf128", "conflicted": "\u2...
5,960
2,065
import unittest from . import * from edg_core.ScalaCompilerInterface import ScalaCompiler class TestConstPropInternal(Block): def __init__(self) -> None: super().__init__() self.float_param = self.Parameter(FloatExpr()) self.range_param = self.Parameter(RangeExpr()) class TestParameterConstProp(Bloc...
7,520
2,702
#Modulo que devuelve tres valores: # pkmn_type_en: lista de str cuyos valores son los nombres de los tipos del pokemon (en ingles) # special_type: lista de str cuyos valores son los nombres de los tipos especiales del pokemon # pkmn_damage_rel: diccionario de listas str cuyos valores son los nombres de los tipos del p...
3,061
1,140
''' Created on 2017年1月15日 @author: Think 题目:一个5位数,判断它是不是回文数。即12321是回文数,个位与万位相同,十位与千位相同。    1.程序分析:同29例 2.程序源代码: ''' from pip._vendor.distlib.compat import raw_input def jcp030(): x = int(raw_input('input a number:\n')) x = str(x) for i in range(len(x)//2): if x[i] != x[-i - 1]: print('...
422
215
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Created by Jongmin Sung (jongmin.sung@gmail.com) Anisotropy data analysis The equation for the curve as published by Marchand et al. in Nature Cell Biology in 2001 is as follows: y = a + (b-a) / [(c(x+K)/K*d)+1], where a is the anisotrop...
2,821
1,336
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
4,519
1,348
from distutils.core import setup setup( name = 'syspy', version = '0.2', url = 'https://github.com/aligoren/syspy', download_url = 'https://github.com/aligoren/syspy/archive/master.zip', author = 'Ali GOREN <goren.ali@yandex.com>', author_email = 'goren.ali@yandex.com', license = 'Apache v2...
492
171
# Generated by Django 3.1.4 on 2021-01-09 20:56 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('products', '0002_auto_20...
1,638
494
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages from distutils.core import Extension import pathlib here = pathlib.Path(__file__).parent.resolve() setup( name='envemind', version='0.0.1', description='Prediction of monoisotopic mass in mass spectra', # long_des...
1,354
409
import argparse import os import subprocess import time from Cython.Build import cythonize import generate_bindings from meson_scripts import copy_tools, download_python, generate_init_files, \ locations, platform_check, generate_godot, \ download_godot generate_bindings.build() def cythonize_files(): m...
5,496
1,664
# ------------------------------- UTILIZANDO MODULOS - AULA 08 ------------------------------- # BIBLIOTECA MATH #from math import sqrt #num = int(input('Digite um Numero: ')) #raiz = sqrt(num) #print('O Valor da raiz de {} é: {:.2f}'.format(num, raiz)) # BIBLIOTECA RANDOM #import random # num = random.random(...
543
218
import os import django from django.conf import settings def pytest_configure(config): """Configure Django.""" os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings') settings.configure() django.setup()
227
73
d=int(input("enter d")) n='' max='' for i in range(d): if i==0: n=n+str(1) else : n=n+str(0) max=max+str(9) n=int(n)+1 #smallest odd no. with d digits if d>1 or 2 if d==1 max=int(max) #largest no. with d digits def check_prime(m_odd): #returns truth value of an odd no. or of 2 being prime if m_odd==2:return T...
763
387
#!/usr/bin/python3 import pytest from brownie.test import strategy from hypothesis import HealthCheck class StateMachine: coin = strategy('uint16', max_value=6) pool = strategy('uint16', max_value=4) valueEth = strategy('uint256', min_value=9 * 10 ** 17, max_value=11 * 10 ** 17) valueUSD6 = strategy(...
24,951
8,436
import owlready2 import yaml import urllib.request import os import gzip import json import sys sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../cellxgene_schema")) import env from typing import List import os def _download_owls( owl_info_yml: str = env.OWL_INFO_YAML, output_dir: str ...
6,285
1,991
from rest_framework import serializers from web.companies.models import Company, DnbGetCompanyResponse class DnbGetCompanyResponseSerializer(serializers.ModelSerializer): class Meta: model = DnbGetCompanyResponse fields = ['id', 'company', 'dnb_data', 'registration_number', 'company_address'] ...
1,337
381
# importing modules and packages # system tools import os import sys import argparse sys.path.append(os.path.join("..", "..")) from contextlib import redirect_stdout # pandas, numpy, gensim import pandas as pd import numpy as np import gensim.downloader # import my classifier utility functions - see the Github repo! ...
5,648
1,526
class Boolable: def __bool__(self): return False class DescriptiveTrue(Boolable): def __init__(self, description): self.description = description def __bool__(self): return True def __str__(self): return f"{self.description}" def __repr__(self): return f"...
1,743
571
#!/usr/bin/env python ''' Central execution points for non-python services ''' import logging from neo4j.v1 import GraphDatabase, basic_auth import neo4j.bolt.connection import elasticsearch.exceptions from isoprene_pumpjack.constants.environment import environment from isoprene_pumpjack.utils.neo_to_d3 import neo_...
1,890
566
# -*- coding: utf-8 -*- from JobBrowserBFF.TestBase import TestBase from JobBrowserBFF.model.EE2Api import EE2Api from JobBrowserBFF.schemas.Schema import Schema ENV = 'ci' USER_CLASS = 'user' UPSTREAM_SERVICE = 'ee2' JOB_ID_HAPPY = '5e8285adefac56a4b4bc2b14' JOB_ID_LOG_HAPPY = '5e8647c576f5df12d4fa6953' JOB_ID_NOT_FO...
11,148
3,694
from ldap3 import ALL_ATTRIBUTES, ALL_OPERATIONAL_ATTRIBUTES from ldap3.protocol.formatters.validators import validate_sid, validate_guid ALL_ATTRIBUTES = ALL_ATTRIBUTES ALL_OPERATIONAL_ATTRIBUTES = ALL_OPERATIONAL_ATTRIBUTES ALL = [ALL_ATTRIBUTES, ALL_OPERATIONAL_ATTRIBUTES] validate_sid = validate_sid validate_guid...
529
211
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** from ... import _utilities import typing # Export this package's modules as members: from ._enums import * from .automation_account import * from .cert...
1,237
355
from __future__ import unicode_literals from django.conf.urls import include, url from django.contrib import admin from auth_extension import views as auth_views from django.contrib.auth.views import login, logout, password_reset, password_reset_done, password_reset_confirm, password_reset_complete from django.conf im...
1,708
572
def fuel_required(weight: int) -> int: return weight // 3 - 2 def fuel_required_accurate(weight: int) -> int: fuel = 0 while weight > 0: weight = max(0, weight // 3 - 2) fuel += weight return fuel def test_fuel_required() -> None: cases = [(12, 2), (14, 2), (1969, 654), (100756, ...
826
349
import sys p = int(sys.stdin.readline()) q = int(sys.stdin.readline()) result = [] for i in range(p,q+1): square = i * i l_num = 0 temp = list(str(square)) #print(temp[:len(temp)//2]) #print(temp[len(temp)//2:]) if square > 10: l_num = int(''.join(temp[:len(temp)//2])) r_num = int(...
499
211
# flake8: noqa from catalyst.dl.callbacks.metrics.accuracy import ( AccuracyCallback, MultiLabelAccuracyCallback, ) from catalyst.dl.callbacks.metrics.auc import AUCCallback from catalyst.dl.callbacks.metrics.cmc import CMCScoreCallback from catalyst.dl.callbacks.metrics.dice import ( DiceCallback, Mul...
808
280
# Generated by Django 2.2.1 on 2019-07-28 08:12 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('login', '0002_auto_20190720_1846'), ] operations = [ migrations.AddField( model_name='user', name='token', ...
451
165
from allauth.account.utils import setup_user_email, send_email_confirmation from rest_framework.response import Response from usersystem.serializers import UserSerializer, UserRegisterSerializer from rest_framework.views import APIView from rest_framework.status import HTTP_200_OK, HTTP_400_BAD_REQUEST, HTTP_201_CREATE...
10,777
3,061
""" sgr commands related to creating and checking out images """ import sys from collections import defaultdict import click from splitgraph.commandline.common import ImageType, RepositoryType, JsonType, remote_switch_option from splitgraph.config import get_singleton, CONFIG from splitgraph.exceptions import TableNo...
13,966
4,041
#!/usr/bin/env python # # ====================================================================== # # Brad T. Aagaard, U.S. Geological Survey # # This code was developed as part of the Computational Infrastructure # for Geodynamics (http://geodynamics.org). # # Copyright (c) 2010-2017 University of California, Davis # #...
1,661
486
import subprocess import json import csv from csv import DictWriter import datetime import pandas as pd import Cmd import Data from Report import Report import File def main(): Data.val_earnings_w_sum_columns() dataframe=Data.get_val_token_info() dataframe.to_csv(File._generate_file_name("fxcored_s...
381
125
# Solution of; # Project Euler Problem 67: Maximum path sum II # https://projecteuler.net/problem=67 # # By starting at the top of the triangle below and moving to adjacent numbers # on the row below, the maximum total from top to bottom is 23. 37 42 4 68 5 9 # 3That is, 3 + 7 + 4 + 9 = 23. Find the maximum total fr...
1,000
356
# -*- coding: utf-8 -*- """ Created on Wed Mar 27 18:19:25 2019 INSTITUTO FEDERAL DE EDUCAÇÃO, CIÊNCIA E TECNOLOGIA DO PÁRA - IFPA ANANINDEUA @author: Prof. Dr. Denis C. L. Costa Discentes: Heictor Alves de Oliveira Costa Lucas Pompeu Neves Grupo...
1,457
586
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import csv import numpy as np import os import sys from observations.util import maybe_download_and_extract def unemp_dur(path): """Unemployment Duration Journal of Business Econ...
1,956
667
f=float(input("Digite a temperatura na escala Farenheit: ")) celsius=5/9*(f-32) print("A temperatura",f,"ºF, Em Célsius é: ",celsius,"ºC")
138
62
""" Elabore um programa que calcule o valor a ser pago por um produto, considerando o seu PREÇO NORMAL e CONDIÇÃO DE PAGAMENTO: - À vista dinheiro/cheque: 10% de desconto - À vista no cartão: 5% de desconto - Em até 2x no cartão: Preço normal - 3x ou mais no cartão: 20% de JUROS """ preco = float(input('Qual o valor d...
1,289
535
import numpy as np import GPy from .GP_interface import GPInterface, convert_lengthscale, convert_2D_format class GPyWrapper(GPInterface): def __init__(self): # GPy settings GPy.plotting.change_plotting_library("matplotlib") # use matpoltlib for drawing super().__init__() self.cen...
11,558
4,158
from flask_adv_deploy import app # Note Gunicorn is not supported in Windows machine. if __name__ == "__main__": app.run()
128
41
class Node: def __init__(self, value, index, next, previous): self.value = value self.next_value = value self.index = index self.next = next self.previous = previous def main(): input_data = read_input() initial_row = input_data.pop(0) # Extract the initial state...
3,938
1,176
# 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. from pathlib import Path from typing import Callable from classy_vision.generic.registry_utils import import_all_modules FILE_ROOT = Path(__...
2,243
732
from django.test import TestCase # Create your tests here. from django.test import TestCase from django.contrib.auth.models import User from .models import Profile class ProfileTestClass(TestCase): ''' test class for Profile model ''' def setUp(self): self.user = User.objects.create_user("tes...
751
241
import os from pathlib import Path from unittest import TestCase import validator.validator as validator from .test_utils import schema, build_map class TestStrangeNames(TestCase): old_cwd = os.getcwd() @classmethod def setUpClass(cls): os.chdir('./tests/workspaces/strange-names') @classmet...
800
256
# David Hickox # Jan 12 17 # HickoxProject2 # Displayes name and classes # prints my name and classes in columns and waits for the user to hit enter to end the program print("David Hickox") print() print("1st Band") print("2nd Programming") print("3rd Ap Pysics C") print("4th Lunch") print("5th Ap Lang...
640
246
'''Tokenizer Class''' # -*- encoding: utf-8 -*- import re from .token_with_pos import TokenWithPos from .patterns import Patterns class Tokenizer(): ''' A basic Tokenizer class to tokenize strings and patterns Parameters: - regexp: regexp used to tokenize the string ''' def __init__(self,...
7,080
2,020